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?

Abhishek
  • 1,008
  • 1
  • 16
  • 39

6 Answers6

32

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

valet park
valet link backend-laravel
Jinal Somaiya
  • 1,931
  • 15
  • 29
  • 2
    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! – DavidG May 01 '20 at 13:52
  • 1
    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. – DavidG May 01 '20 at 23:56
  • "from your project directory" seems wrong here. "from the root of your laravel projects" seems more correct, as per Prakash's answer – Dave Nottage Nov 23 '21 at 01:33
3

You should run:

valet park

on your main folder (where all the laravel projects are stored) while the folders inside the main folder are the project folders and folder_name_inside_the_main_folder.test opens the project on your browser.

OR

You should run:

valet link

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

Hope it helps someone!!!

Prakash Poudel
  • 434
  • 1
  • 5
  • 17
3

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

1

You should run:

valet park

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

Christakitos
  • 146
  • 1
  • 11
0

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.

Solar
  • 870
  • 9
  • 18
-2

Try to reinstall valet
run valet uninstall and valet install