ldc-nature-and-respect/database/factories/StoreRegionFactory.php

34 lines
664 B
PHP
Raw Normal View History

2023-03-16 09:47:16 +01:00
<?php
namespace Database\Factories;
use App\Models\StoreGroup;
use App\Models\StoreRegion;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<\App\Models\StoreRegion>
*/
final class StoreRegionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = StoreRegion::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'name' => fake()->name,
'group_id' => fake()->randomElement(StoreGroup::pluck('id'))
];
}
}