vbytes_lan/app/Filament/Resources/Mailtemplates/Schemas/MailtemplateForm.php
2026-05-21 18:40:00 +02:00

39 lines
1.2 KiB
PHP

<?php
namespace App\Filament\Resources\Mailtemplates\Schemas;
use App\Models\Smstemplate;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Schema;
use Filament\Forms\Components\MarkdownEditor;
use DiscoveryDesign\FilamentGaze\Forms\Components\GazeBanner;
class MailtemplateForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
GazeBanner::make()
->pollTimer(10)
->hideOnCreate(),
TextInput::make('title')
->required()
->columnSpanFull(),
MarkdownEditor::make('content')
->required()
->columnSpanFull(),
Select::make('smstemplate_id')
->label('SMS template')
->options(Smstemplate::where('draft', false)->pluck('title', 'id'))
->nullable()
->columnSpanFull(),
Toggle::make('draft')
->default(false)
->onColor('warning')
->columnSpanFull(),
]);
}
}