Compare commits

..

No commits in common. "7e1f1184fe3c6330dc0abd678957c2008255a3dd" and "0ca5a445f5bd06b9a27f1ce26554b815a53d08f1" have entirely different histories.

2 changed files with 4 additions and 7 deletions

View File

@ -10,7 +10,7 @@ class HistoryObserver
History::create([ History::create([
'model_id' => $model->id, 'model_id' => $model->id,
'model_name' => $model->getTable(), 'model_name' => $model->getTable(),
'before' => [], 'before' => null,
'after' => $model->toArray(), 'after' => $model->toArray(),
'action' => HistoryAction::Insert, 'action' => HistoryAction::Insert,
]); ]);
@ -33,7 +33,7 @@ class HistoryObserver
'model_id' => $model->id, 'model_id' => $model->id,
'model_name' => $model->getTable(), 'model_name' => $model->getTable(),
'before' => $model->getRawOriginal(), 'before' => $model->getRawOriginal(),
'after' => [], 'after' => null,
'action' => HistoryAction::Delete, 'action' => HistoryAction::Delete,
]); ]);
} }

View File

@ -16,11 +16,8 @@ class DatabaseSeeder extends Seeder
// User::factory(10)->create(); // User::factory(10)->create();
User::factory()->create([ User::factory()->create([
'last_name' => fake()->lastName, 'name' => 'Test User',
'name' => fake()->name, 'email' => 'test@example.com',
'middle_name' => fake()->name(),
'phone' => fake()->unique()->phoneNumber,
'email' => fake()->unique()->safeEmail,
]); ]);
} }
} }