ldc-com-app-bo/database/factories/DirectoryFactory.php

41 lines
973 B
PHP
Raw Normal View History

2023-03-31 15:20:10 +02:00
<?php
namespace Database\Factories;
use App\Models\Directory;
2025-05-20 16:20:23 +02:00
use App\Models\Tenant;
2023-03-31 15:20:10 +02:00
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<\App\Models\Directory>
*/
class DirectoryFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Directory::class;
/**
* Define the model's default state.
*
* @return array
*/
2025-05-20 16:20:23 +02:00
public function definition(): array
2023-03-31 15:20:10 +02:00
{
return [
2025-05-20 16:20:23 +02:00
'name' => [
2023-03-31 15:20:10 +02:00
"fr" => $this->faker->unique()->word,
"en" => $this->faker->unique()->word,
"de" => $this->faker->unique()->word,
"nl" => $this->faker->unique()->word,
],
2025-05-20 16:20:23 +02:00
'directory_id' => null,
2023-03-31 15:20:10 +02:00
'needAuthorization' => $this->faker->boolean(50),
2025-05-20 16:20:23 +02:00
'tenant_id' => Tenant::query()->first('id'),
2023-03-31 15:20:10 +02:00
];
}
}