xxxxxxxxxx
php artisan make:model Model -mf
// -mf creates the factory and migration
xxxxxxxxxx
// Model Naming Convention: singular, ProperCase EG: User, UserRequest
php artisan make:model Flight -f // with Factory
php artisan make:model Flight -s // with Seeder
php artisan make:model Flight -c // with Controller
php artisan make:model Flight -m // with Migration
// EG: use any flag combo to create Model with Migration, Factory, Seeder and Controller
php artisan make:model Flight -mfsc
xxxxxxxxxx
$user = User::create([
'first_name' => 'Taylor',
'last_name' => 'Otwell',
'title' => 'Developer',
]);
$user->title = 'Painter';
$user->isDirty(); // true
$user->isDirty('title'); // true
$user->isDirty('first_name'); // false
$user->isClean(); // false
$user->isClean('title'); // false
$user->isClean('first_name'); // true
$user->save();
$user->isDirty(); // false
$user->isClean(); // true
xxxxxxxxxx
php artisan make:model Flight --factory
php artisan make:model Flight -f
php artisan make:model Flight --seed
php artisan make:model Flight -s
php artisan make:model Flight --controller
php artisan make:model Flight -c
php artisan make:model Flight -mfsc
xxxxxxxxxx
//Generate model with migration, factory, seeder, and controller
php artisan make:model Post -mfsc
xxxxxxxxxx
php artisan make:model ModelName --migration --factory --controller -r --seed
// this commands generate a migration, model, factory, resource controller, and seeder