generated from liutk/owl-admin-base
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Employee;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Slowlyo\OwlAdmin\Models\AdminUser;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Employee>
|
|
*/
|
|
class EmployeeFactory extends Factory
|
|
{
|
|
protected $model = Employee::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$faker = $this->faker;
|
|
$name = $faker->name;
|
|
$phone = $faker->phoneNumber();
|
|
|
|
// $adminUser = AdminUser::create([
|
|
// 'username' => $phone,
|
|
// 'password' => bcrypt($phone),
|
|
// 'name' => $name,
|
|
// ]);
|
|
// $adminUser = AdminUser::first();
|
|
return [
|
|
'name' => $name,
|
|
'phone' => $phone,
|
|
'prize_images' => ['https://via.placeholder.com/100x100.png'],
|
|
'skill_images' => ['https://via.placeholder.com/100x100.png'],
|
|
// 'admin_user_id' => $adminUser->id,
|
|
'join_at' => now(),
|
|
];
|
|
}
|
|
}
|