HelloCSE/database/factories/ProfileFactory.php

25 lignes
650 o
PHP
Brut Vue normale Historique

2024-04-10 13:56:22 +02:00
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Http\Controllers\Core\Users;
use App\Http\Utility\debug;
class ProfileFactory extends Factory
{
public function definition(){
$adminList=Users::getAdminIdList();
$creatorId=$adminList[rand(0, count($adminList)-1)];
return [
'name'=>$this->faker->firstName(),
'last_name'=>$this->faker->lastName(),
'creator_id'=>$creatorId,
'status'=>$this->faker->numberBetween(0, 2),
'creation_date' => time(),
'modification_date' => time(),
];
}
}