23 lines
452 B
PHP
23 lines
452 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Subject;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Subject>
|
|
*/
|
|
class SubjectFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
$name = fake()->unique()->randomElement(['mathematics', 'physics', 'chemistry', 'biology', 'arabic']);
|
|
|
|
return [
|
|
'name' => ucfirst($name),
|
|
'slug' => $name,
|
|
];
|
|
}
|
|
}
|