40 lines
975 B
PHP
40 lines
975 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Store;
|
|
use App\Models\StoreRegion;
|
|
use App\Models\StoreType;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<\App\Models\Store>
|
|
*/
|
|
final class StoreFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Store::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'state' => fake()->word,
|
|
'type_id' => fake()->randomElement(StoreType::pluck('id')),
|
|
'street' => fake()->streetName,
|
|
'zipcode' => fake()->numberBetween(00001, 99999),
|
|
'city' => fake()->city,
|
|
'latitude' => fake()->latitude,
|
|
'longitude' => fake()->longitude,
|
|
'region_id' => fake()->randomElement(StoreRegion::pluck('id')),
|
|
];
|
|
}
|
|
}
|