Jump to Categories


Via Composer Create-Project

composer create-project --prefer-dist laravel/laravel NAME


To start the server

vagrant up

To get inside the server

vagrant ssh


Access mysql inside vagrant

// Passwrod secret
mysql -u homestead -p

Create database

// Passwrod secret
create database NAME


See options

php artisan

See more info about a command

// php artisan help COMMAND
php artisan help make:controller

See Route list

php artisan route:list

Make controller

php artisan make:controller NAME

Database migration

php artisan make:migration create_todo_list_table --table=todo_lists

Run migration

php artisan migrate

Site setup

When SSH'ed into vagrant and in the 'Sites' folder, Install and create project with composer

composer create-project laravel/laravel auth --prefer-dist

Edit the homstead.yaml file, adding new site. Need to run 'vagrant provision' to update homestead.

- map: whatever.dev
      to: /home/vagrant/Sites/whatever/public

Add line to hosts file	whatever.dev

Create controller(s)

php artisan make:controller NAME

Tie routes to the controller. If required can do a resource in the routes file to get a RESTful pattern

Route::resource('auth', 'authController');