Laravel Quick Set Up Notes

We’d love to cover the development environment setup for Laravel, limited time and too many options.

Think Digital Ocean, Homestead, Localhost, etc. for setting up a local or online development. Many tutorials online for this.

Here we simply output code snippets used in command line to tinkering with Laravel (as it’s hard to commit all to memory)

Installation

Install Laravel command line installer

composer global require "laravel/installer"

Create a new project

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

Scaffold authentication system

php artisan make:auth

Database

Make:migration – create a database table

php artisan make:migration create_some_table --create=some_table

Add fields to table from new migration

$table->string('title');
$table->string('url’)->unique();
$table->text('description');

Review .env file for database settings

DB_DATABASE=***
DB_USERNAME=***
DB_PASSWORD=***

Save & run migration

php artisan migrate

Should create:

  1. users table
  2. passwords reset table
  3. new custom table

Views

Need to install package control within Sublime Text? Once done, within command, search for blade syntax highlighter

Create Controller

using Artisan

php artisan make:controller YourControllerName
php artisan make:controller YourControllerName --resource // restful controller