52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Document;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DocumentAssignment>
|
|
*/
|
|
class DocumentAssignmentFactory extends Factory
|
|
{
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'document_id' => Document::factory(),
|
|
'user_id' => User::factory(),
|
|
'role' => fake()->randomElement(['رادیولوژیست', 'پزشک', 'تکنسین', 'سرپرست']),
|
|
];
|
|
}
|
|
|
|
public function radiologist(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'role' => 'رادیولوژیست',
|
|
]);
|
|
}
|
|
|
|
public function doctor(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'role' => 'پزشک',
|
|
]);
|
|
}
|
|
|
|
public function technician(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'role' => 'تکنسین',
|
|
]);
|
|
}
|
|
|
|
public function supervisor(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'role' => 'سرپرست',
|
|
]);
|
|
}
|
|
}
|