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>
47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Testimonials\Schemas;
|
|
|
|
use App\Support\PublicImageUploadRules;
|
|
use Filament\Forms\Components\DateTimePicker;
|
|
use Filament\Forms\Components\Textarea;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Toggle;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class TestimonialForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
Textarea::make('quote')
|
|
->label('Depoimento')
|
|
->required()
|
|
->rows(4),
|
|
TextInput::make('author_name')
|
|
->label('Nome do autor')
|
|
->required()
|
|
->maxLength(255),
|
|
TextInput::make('context')
|
|
->label('Contexto')
|
|
->maxLength(255),
|
|
PublicImageUploadRules::fileUpload('photo_path', 'Foto', 'content/testimonials'),
|
|
PublicImageUploadRules::altTextField('photo_alt', 'photo_path'),
|
|
TextInput::make('sort_order')
|
|
->label('Ordem')
|
|
->numeric()
|
|
->default(0)
|
|
->required(),
|
|
Toggle::make('is_featured')
|
|
->label('Destaque')
|
|
->default(false),
|
|
DateTimePicker::make('published_at')
|
|
->label('Publicado em')
|
|
->seconds(false),
|
|
]);
|
|
}
|
|
}
|