finishes 13 and 14
This commit is contained in:
38
database/factories/LogFactory.php
Normal file
38
database/factories/LogFactory.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Log;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* Factory for generating Log test data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Log>
|
||||
*/
|
||||
final class LogFactory extends Factory
|
||||
{
|
||||
protected $model = Log::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'action' => fake()->randomElement([
|
||||
'login',
|
||||
'logout',
|
||||
'session_started',
|
||||
'session_completed',
|
||||
'screening_started',
|
||||
'screening_completed',
|
||||
]),
|
||||
'metadata' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user