Kenneth
Kenneth
FFilament
Created by Kenneth on 11/14/2024 in #❓┊help
"Create & Create another" doesn't work on custom action
I debugged it this far and concluded it only closes my modal when a custom action is used. All non-custom action creates work and leaves the modal open. My code:
return CreateAction::make()
->form([
TextInput::make('email')
->label(__('form_fields.email'))
->email()
->maxLength(255)
->required(),

TextInput::make('password')
->password()
->label(__('form_fields.password'))
->maxLength(255)
->required(),
])
->action(function (CreateAction $action, array $data) {
try {
...
} catch (Exception $exception) {
...
}
});
return CreateAction::make()
->form([
TextInput::make('email')
->label(__('form_fields.email'))
->email()
->maxLength(255)
->required(),

TextInput::make('password')
->password()
->label(__('form_fields.password'))
->maxLength(255)
->required(),
])
->action(function (CreateAction $action, array $data) {
try {
...
} catch (Exception $exception) {
...
}
});
I've tried a hard createAnother function call within ->action() itself and between ->form() and ->action(), but nothing seems to work. I'm out of ideas and I'm in an infinte loop with Phind and ChatGPT. I'm using Filament v3
2 replies
FFilament
Created by Kenneth on 11/5/2024 in #❓┊help
Split table actions
I would like to split some of my table actions to the front and leave the rest at the end of the table.
$table->actions([
// FIXME: ActionsPosition::BeforeCells
LoginAction::run(),

// FIXME: ActionsPosition::AfterCells
EditAction::make()
->label(__('table_fields.actions.edit'))
->label('')
->tooltip(__('table_fields.actions.edit'))
->size('lg')
->icon('heroicon-o-pencil-square'),

DeleteAction::make()
->label('')
->tooltip(__('table_fields.actions.delete'))
->size('lg')
->icon('heroicon-o-trash'),
]);
$table->actions([
// FIXME: ActionsPosition::BeforeCells
LoginAction::run(),

// FIXME: ActionsPosition::AfterCells
EditAction::make()
->label(__('table_fields.actions.edit'))
->label('')
->tooltip(__('table_fields.actions.edit'))
->size('lg')
->icon('heroicon-o-pencil-square'),

DeleteAction::make()
->label('')
->tooltip(__('table_fields.actions.delete'))
->size('lg')
->icon('heroicon-o-trash'),
]);
I asked ChatGPT (for once) if it is possible and he came with a solution that seems to be removed in v3 (Filament\Tables\Actions\Position has moved to Filament\Tables\Enums\ActionsPosition) Perhaps it is not possible what I am trying to do, but thought I'd ask for help before giving up 🫡 My apologies if it is a real simple fix and I should've read better
6 replies