Laravel New Project Steps

Here are my steps for creating a new laravel project. I know the docs are excellent but these are the steps specific to my setup, which is probably pretty common. For reference, I use the laravel installer to create new projects and I use Homestead. I already have Homestead set up so it’s just a matter of changing a few things and the inevitable updates, since this is something I don’t do frequently (thus the need for notes).

1. update laravel installer
composer global update "laravel/installer"

2. create the laravel project
laravel new projectname
cd projectname

3. Update Homestead
cd into your Homestead directory and edit the Homestead.yaml file
Add a new entry to the sites section

4. run
vagrant reload --provision

5. Update your hosts file to add projectname
open -a "Sublime Text" /etc/hosts
use .test extension (I’ve had issues with Chrome and .dev or .app extensions not working)

6. Launch the vagrant box
vagrant up

7. SSH into Homestead and cd into the projectname directory
run
composer install

9. Create a .env file in your project root
Copy everything from .env.example into .env

10. Generate the Application Key from Homestead (all php artisan commands have to be run from Homestead on my setup)
php artisan key:generate

11. Navigate to your projectname.test in the browser – you should get the Laravel welcome page

Leave a Reply

Your email address will not be published. Required fields are marked *