[wip] create main tables relation

This commit is contained in:
gregorio
2022-07-26 07:01:25 +07:00
parent f98ca8d532
commit 5021507cf6
32 changed files with 1324 additions and 168 deletions

View File

@@ -0,0 +1,58 @@
<?php
namespace Database\Factories;
use App\Models\Group;
use Illuminate\Database\Eloquent\Factories\Factory;
class AclGroupFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string|null
*/
protected $model = Group::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->unique()->randomElement([
'personalia', 'supervisor', 'staff',
]),
'guard_name' => 'web',
];
}
public function personalia(): static
{
return $this->state(function (array $attributes) {
return [
'name' => 'personalia',
];
});
}
public function supervisor(): static
{
return $this->state(function (array $attributes) {
return [
'name' => 'supervisor',
];
});
}
public function staff(): static
{
return $this->state(function (array $attributes) {
return [
'name' => 'staff',
];
});
}
}