35 lines
782 B
PHP
35 lines
782 B
PHP
<?php
|
|
|
|
namespace Modules\Employee\Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class DepartmentFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*/
|
|
protected $model = \Modules\Employee\Models\Department::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
static $order = 1;
|
|
$title = $this->faker->firstName();
|
|
|
|
return [
|
|
'title' => $title,
|
|
'slug' => Str::slug($title),
|
|
'status' => $this->faker->randomElement([0, 1]),
|
|
'order' => $order++,
|
|
'user_id' => 1,
|
|
'createdby' => 1,
|
|
'updatedby' => 1,
|
|
];
|
|
}
|
|
}
|
|
|