How to run laravel project from bash file?

by wilmer.lemke , in category: PHP Frameworks , 22 days ago

How to run laravel project from bash file?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dalton_moen , 21 days ago


To run a Laravel project from a bash file, you can create a bash script that runs the PHP artisan serve command. Here is an example of how you can do this:

  1. Create a new bash script file, for example,

  1. Edit the file and add the following code:

cd /path/to/your/laravel/project
php artisan serve

Make sure to replace /path/to/your/laravel/project with the actual path to your Laravel project directory.

  1. Save the file and give it executable permissions:
chmod +x

  1. Run the bash script by executing the following command in your terminal:

This will change the directory to your Laravel project directory and then run the PHP artisan serve command, which will start the Laravel development server.