36 lines
849 B
PHP
36 lines
849 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Tenant;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Range>
|
|
*/
|
|
class RangeFactory extends Factory
|
|
{
|
|
/**
|
|
* Range order
|
|
*
|
|
* @var integer
|
|
*/
|
|
private static int $order = 0;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => 'gamme ' . fake()->unique()->streetName(),
|
|
'color' => fake()->unique()->hexColor(),
|
|
'width' => fake()->numberBetween(1, 2),
|
|
'order' => self::$order++,
|
|
'status' => fake()->boolean(75),
|
|
'tenant_id' => Tenant::query()->first('id'),
|
|
];
|
|
}
|
|
}
|