ldc-lionor/database/factories/ShopFactory.php

37 lines
1 KiB
PHP
Raw Permalink Normal View History

2023-02-24 15:20:58 +00:00
<?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(),
2023-08-28 08:46:47 +00:00
'signs' => collect(SignsEnum::toArray())->random()->value,
2023-02-24 15:20:58 +00:00
'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),
2023-02-24 15:20:58 +00:00
];
}
}