Quick Commands

Laravel Installer

This will let you quick start new laravel projects.

1// first you must install it
2composer global require laravel/installer
3 
4// than you can create new projects with
5laravel new example-app
6 
7// adding --jet will install with Laravel JetStream
8// This includes Alpine, Tailwind, and Livewire configured
9laravel new example-app --jet

Creating Models

1// create a new model
2// use Singluar version
3php artisan make:model Book // not Books
4php artisan make:model BookNote // not BookNotes
5 
6// create model with migration and factory seeder
7php artisan make:model Book -mf

Database Migration

1// create new migration file
2// Covention: use _tables and plural versions
3php make:migration create_books_table // Correct
4php make:migration create_book_table // Incorrect
5 
6// create fresh migration
7php artisan migrate:fresh
8 
9// create fresh migration and run seeder files
10php artisan migrate:fresh --seed
11 
12// run migration and force run of all the files
13php artisan migrate --force