Laravel - valet 404 not found
Asked Answered
C

7

15

I have a laravel project which was working fine in http with php artisan serve. But I was working on a project where I needed to implement Facebook Login API which requires call from https, for doing this I installed valet globally executed following command:

 valet link backend-laravel
 valet secure backend-laravel

Here is the screenshot of valet links valet links

Now when i enter https://backend-laravel.test it shows 404 error.

How can make it running? Is there something I missed?

Convection answered 27/8, 2018 at 12:25 Comment(6)
run valet park from your project directory.Petronilapetronilla
from inside the backend-laravel or outside. PS: dir name is backend-laravelConvection
inside the backend-laravelPetronilapetronilla
I executed the command and got following result This directory has been added to Valet's paths. but still the URL is showing 404. Do I need to restart some service ?Convection
No try to run valet link backend-laravel from backend-laravel directoryPetronilapetronilla
@JinalSomaiya thanks it worked! Kindly post your answer so I can accept itConvection
P
33

Run following commands from the root of your laravel projects directory:

valet park
valet link backend-laravel
Petronilapetronilla answered 27/8, 2018 at 12:47 Comment(3)
I wish I would have seen this thread a few days ago. I did a fresh OS install to download and setup tools I use so that I can image my mac. I've done it several times now... 5 to be exact. Your comments above worked perfectly. I edited the answer to include the valet park which was discussed in comments to OP. Thanks for the solution!Ferromagnetism
You can run these commands in a directory containing multiple site directories. On my mac I use Sites folder to hold all of my projects. Run it in the directory you keep your sites in and it will serve all of them.Ferromagnetism
"from your project directory" seems wrong here. "from the root of your laravel projects" seems more correct, as per Prakash's answerUnstriped
C
4

naming convention for project directory should follow kabab case.

correct : backend-project

incorrect : backend_project

and hit "backend-project" in browser. by the way it will work for both directories backend-project and backend_project

Cultism answered 21/1, 2021 at 5:13 Comment(1)
This naming convention solved my problem! Changed my directory from snake case to kebab case and it's resolving fine now. Thanks!Balkin
N
3

You should run:

valet park

In the main folder, where all the Laravel projects are stored, the project folders are located. To open a project in your browser, you should access it by using the URL format: "folder_name_inside_the_main_folder.test."

OR

You should run:

valet link

on your project folder and open foldername.test on the browser.

Hope it helps someone!!!

Nembutal answered 25/4, 2020 at 11:4 Comment(0)
P
1

You should run:

valet park

from your project folder to add it to Valet's paths.

Papule answered 22/9, 2019 at 11:4 Comment(0)
T
1

In my own case (Vanilla PHP project), public folder was the cause of my issue.

Inside my project folder, I have a public folder that houses all my assets.

Turns out the valet driver checks inside the public folder for index.php which makes sense because that's how Laravel is configured.

So I had to rename the public folder that house all my assets to assets.

You can rename it to whatever you want.

Thrashing answered 30/7, 2023 at 4:32 Comment(0)
F
0

Make sure docker is not occupying port 80. Shut it down and then valet restart

Foreigner answered 1/5 at 4:33 Comment(0)
L
-2

Try to reinstall valet
run valet uninstall and valet install

Liberalism answered 9/11, 2022 at 21:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.