36 lines
1 KiB
PHP
36 lines
1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\SignsEnum;
|
|
use App\Models\Shop;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class ShopFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Shop::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
return [
|
|
'name' => $this->faker->unique()->company(),
|
|
'signs' => collect(SignsEnum::toArray())->random()->value,
|
|
'address' => $this->faker->randomNumber(3, false) . ', ' .
|
|
$this->faker->unique()->words((int)$this->faker->randomFloat(0, 2, 3), true),
|
|
'city' => $this->faker->city(),
|
|
'postcode' => \str_replace(' ', '', $this->faker->postcode()),
|
|
'latitude' => $this->faker->randomFloat(9, -90, 90),
|
|
'longitude' => $this->faker->randomFloat(9, -180, 80),
|
|
];
|
|
}
|
|
}
|