Via Composer Create-Project

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

 

Inside Vagrant

To start the server

vagrant up

To get inside the server

vagrant ssh

 

MySQL

Access mysql inside vagrant

// Passwrod secret
mysql -u homestead -p

Create database

// Passwrod secret
create database NAME

 

Artisan

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

127.0.0.1	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');

Posted on

Other library topics

Next/Prev

Worthy of Note

Worthy of Note is a site aimed at Web Designers & Developers. It offers a wide range of resources to help assist anyone in the web industry.

View