Files
econom/database/factories/DepartmentFactory.php
brusnitsyn fb2e6c58e3
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
first commit
2026-04-06 00:06:00 +09:00

38 lines
794 B
PHP

<?php
namespace Database\Factories;
use App\Models\Department;
use App\Models\DepartmentProfile;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Department>
*/
class DepartmentFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->unique()->companySuffix(),
'is_active' => true,
'department_profile_id' => DepartmentProfile::factory(),
];
}
/**
* Indicate that the department is inactive.
*/
public function inactive(): static
{
return $this->state(fn (array $attributes) => [
'is_active' => false,
]);
}
}