laravel create on model

Solutions on MaxInterview for laravel create on model by the best coders in the world

showing results for - "laravel create on model"
Persephone
06 Sep 2016
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