This is a simple Composer script which listed basic commands that is used to setup a Laravel project in a shared hosting or VPS.
npm install
: Install NPM packages.composer install
: Install Composer packages.php artisan storage:link
: Create symbolic links.php artisan migrate
: Migrate the database tables.npm run prod
: Compile assets with Laravel Mix.php artisan key:generate
: Generate application key.
- Insert the following event inside
scripts
property incomposer.json
file.Example:"install-project": [ "npm install && npm run prod", "composer install", "@php artisan storage:link", "@php artisan migrate", "@php artisan key:generate" ]
"scripts": { "install-project": [ "npm install && npm run prod", "composer install", "@php artisan storage:link", "@php artisan migrate", "@php artisan key:generate" ], },
- Run
composer install-project
inside your terminal. - Done!
-
Why did you create this script?
This is because I usually forget a few steps when setting up any Laravel project in shared hosting or VPS.
-
Why don't you turn this into a package?
Because, I don't know how :)
-
I have a suggestion to add new commands.
Open an issue and I'll try to look it up.
Laravel is a Trademark of Taylor Otwell.