*/ class PaletteFactory extends Factory { protected $model = Palette::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $colors = collect(range(1, 6)) ->map(fn () => mb_strtoupper($this->faker->hexColor())) ->map(fn (string $hex) => mb_ltrim($hex, '#')) ->implode(','); return [ 'name' => $this->faker->unique()->slug(), 'description' => $this->faker->sentence(), 'palette' => $colors, ]; } }