ldc-legaulois/database/factories/SubmeatFactory.php
2024-10-24 08:45:29 +00:00

32 lines
935 B
PHP

<?php
namespace Database\Factories;
use App\Models\Meat;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class SubmeatFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$label = fake()->unique()->words(rand(1, 2), true);
return [
'label' => $label,
'subtitle' => fake()->text(10),
'slug' => Str::slug($label),
'description' => fake()->sentence(),
'picture' => '',
'picture_alt' => fake()->sentence(),
'picture_title' => fake()->sentence(),
'meat_id' => Meat::query()->where('published', true)->inRandomOrder()->value('id'),
'order' => 1,
'published' => fake()->boolean(75),
];
}
}