Implement superadmin audit log for mutations
This commit is contained in:
42
database/factories/SuperAdminActionLogFactory.php
Normal file
42
database/factories/SuperAdminActionLogFactory.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\SuperAdminActionLog;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\SuperAdminActionLog>
|
||||
*/
|
||||
class SuperAdminActionLogFactory extends Factory
|
||||
{
|
||||
protected $model = SuperAdminActionLog::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'actor_id' => User::factory(),
|
||||
'action' => $this->faker->randomElement([
|
||||
'tenant.updated',
|
||||
'photo.approved',
|
||||
'user.created',
|
||||
]),
|
||||
'subject_type' => User::class,
|
||||
'subject_id' => User::factory(),
|
||||
'source' => $this->faker->randomElement([
|
||||
'App\\Filament\\Resources\\TenantResource',
|
||||
'App\\Filament\\Clusters\\DailyOps\\Resources\\Photos\\PhotoResource',
|
||||
]),
|
||||
'metadata' => [
|
||||
'fields' => ['status', 'moderated_at'],
|
||||
],
|
||||
'occurred_at' => now(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user