aboutsummaryrefslogtreecommitdiffstats
path: root/source/database/factories/LogFactory.php
blob: 5fc7de0071f502d6e777ee45aae7bee0de3c6ba1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace Database\Factories;

use App\Models\Log;
use App\Models\Student;
use Illuminate\Database\Eloquent\Factories\Factory;

class LogFactory extends Factory
{
    protected $model = Log::class;

    public function definition(): array
    {
        return [
            'actor' => $this->faker->randomElement(['Student', 'Company']),
            'action' => $this->faker->randomElement(['create', 'delete', 'update','read']),
            'actor_id' => Student::factory(),
            'target_type' => $this->faker->randomElement(['Student', 'Admin', 'Company' ]),
            // dit eve een random id laten aanmaken maar in de toekmost een studenten id of company id
            'severity' => $this->faker->randomElement(['normal', 'critical'])
        ];
    }
}