Files
amare/database/factories/TestimonialFactory.php
manoel freitas 8da8d19504 feat: CMS de conteúdo do site (WEB-02/03/04/06)
Implementa gestão Filament de configurações, serviços, portfólio e depoimentos com policies admin-only, upload validado e seed determinístico.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 23:16:25 -03:00

48 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\Testimonial;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Testimonial>
*/
class TestimonialFactory extends Factory
{
protected $model = Testimonial::class;
/**
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'quote' => fake()->paragraph(),
'author_name' => fake()->name(),
'context' => fake()->optional()->jobTitle(),
'photo_path' => null,
'photo_alt' => null,
'sort_order' => 0,
'is_featured' => false,
'published_at' => null,
];
}
public function published(): static
{
return $this->state(fn (array $attributes): array => [
'published_at' => now(),
]);
}
public function featured(): static
{
return $this->state(fn (array $attributes): array => [
'is_featured' => true,
]);
}
}