Useful Resources
- Official website
- Laravel 5 fundamental tutorials on laracasts
- Composer – dependency manager for PHP
- click on “Browse Package” to go to packagist.org to search for packages
- List of laravel resources – base project, cheat sheet, community etc
- Laravel cheat sheet
- Laravel cheat sheet 2
- Model & migration generator
- View generator
Quick notes (I’m using a Mac)
Downloading composer
- Run this in terminal
- curl -sS https://getcomposer.org/installer | php
- Once successful
- You got a message
- A file composer.phar on current directory
- To run the file, type
- php composer.phar
- Or move to globally accessible directory
- mv composer.phar /usr/local/bin/composer
- To download a package (example). This download requires Git to be installed
- composer require laravel/laravel
- wait for composer to download all the packages and update the .json file
Create a laravel project
- Run this command on terminal. You better set your current directory to web directory
- composer create-project –prefer-dist laravel/laravel blog
Commonly-used Artisan Command
- php artisan list (to list all artisan commands available)
- php artisan –version (to view laravel version)
- php artisan help <command_name> (to view help for a command)
- php artisan make
- php artisan make:controller <fooController> –resource (create a resource controller with default methods. i.e. index, show, create, store, edit, update, destroy)
- php artisan make:model Student –migration (will create a model of student and database migration of students table)
- php artisan make:migration create_users_table (will create a migration file in database/migration directory)
- php artisan migrate (to migrate database)
- php artisan migrate –seed (migrate database and load seeder)
- php artisan migrate:status
- php artisan migrate:refresh (remove all and remigrate)
- more about migration
-
composer dump-autoload – to regenerate autoload files. especially when error run migrate or db seed.
Package browsers
- packalyst.com (laravel only)
- packagist.org (php packages)
Some useful packages/sample applications
- laravel admin package – voyager
- open source laravel crm – flarepoint
Laravel Homestead and Valet
- Haven’t had time to go through yet
- Valet is not using vagrant and very simple
- Only run on mac