public static function form(Form $form): Form
{
$userModel = app(FilamentLatex::class)->getUserModel();
return $form
->schema([
Section::make()
->schema([
TextInput::make('name')
->label('Document Title')
->required(),
DateTimePicker::make('deadline')
->required()
->native(false)
->placeholder('DD-MM-YYYY HH:MM')
->suffixIcon('heroicon-m-calendar')
->format('Y-m-d H:i:s')
->displayFormat('d-m-Y H:i'),
Group::make([
TextInput::make('author_id')
->disabled()
->dehydrated(false)
->formatStateUsing(fn (?string $state): string => $state ?? auth()->user()->name),
])->relationship('author'),
Select::make('collaborators_id')
->label('Collaborators')
->multiple()
->options(fn () => $userModel::all()->pluck('name', 'id'))
->searchable(),
])->columns(2),
]);
}
public static function form(Form $form): Form
{
$userModel = app(FilamentLatex::class)->getUserModel();
return $form
->schema([
Section::make()
->schema([
TextInput::make('name')
->label('Document Title')
->required(),
DateTimePicker::make('deadline')
->required()
->native(false)
->placeholder('DD-MM-YYYY HH:MM')
->suffixIcon('heroicon-m-calendar')
->format('Y-m-d H:i:s')
->displayFormat('d-m-Y H:i'),
Group::make([
TextInput::make('author_id')
->disabled()
->dehydrated(false)
->formatStateUsing(fn (?string $state): string => $state ?? auth()->user()->name),
])->relationship('author'),
Select::make('collaborators_id')
->label('Collaborators')
->multiple()
->options(fn () => $userModel::all()->pluck('name', 'id'))
->searchable(),
])->columns(2),
]);
}