Laravel - how to serve a new laravel project to browser

15,833

Solution 1

yes, you can do it by using following in your terminal.

open your terminal, and navigate to directory where you have your project abc

and fire following command

php artisan serve

enter image description here

Now you can access it in browser by going to http://localhost:8000

hope you get it

Solution 2

I just want to add to the answer of Mubin Khalid . You can choose your own port number like

php artisan serve --port=8080

This is helpful when running two or more project.

Share:
15,833
Exbi
Author by

Exbi

Updated on June 04, 2022

Comments

  • Exbi
    Exbi about 2 years

    This is the first time I've used a PHP framework.

    I've been following the Laravel documentation to install Composer and Laravel, and everything seems to have gone smoothly.

    But now I've finished the installation/configure instructions, and I have created a project, I can't see any instructions on how to serve my application so it's viewable via a browser?

    I have used Ruby on Rails before, which came with an easy way to get an instance of the application running via a built-in web server.

    Is there something similar with Laravel, or do I need to somehow configure my standard Apache instance to serve the application?

    I'm guessing there is something I've overlooked or misunderstood in the documentation.