Compare commits

..

2 Commits

Author SHA1 Message Date
b1ek 7e1f1184fe
feat: proper faker 2024-08-30 08:10:16 +10:00
b1ek 7cee091b6d
fix: nullable db error 2024-08-30 08:10:05 +10:00
2 changed files with 7 additions and 4 deletions

View File

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

View File

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