1# The easiest way to create a model instance is using the
2# make:model Artisan command:
3
4php artisan make:model Flight
5
6# If you would like to generate a database migration when you
7# generate the model, you may use the --migration or -m option:
8
9php artisan make:model Flight --migration
10php artisan make:model Flight -m
1$user = User::create([
2 'first_name' => 'Taylor',
3 'last_name' => 'Otwell',
4 'title' => 'Developer',
5]);
6
7$user->title = 'Painter';
8
9$user->isDirty(); // true
10$user->isDirty('title'); // true
11$user->isDirty('first_name'); // false
12
13$user->isClean(); // false
14$user->isClean('title'); // false
15$user->isClean('first_name'); // true
16
17$user->save();
18
19$user->isDirty(); // false
20$user->isClean(); // true
1php artisan make:model Flight -mcr
2 #it will make model with name of Flight
3 #it will also create conctroller file with FlightController name
4 #all function will present in this Controller (index, create, store, show, edit, update, destroy)
5