TomEasterbrook98
Action breaks when requiring confirmation
I havre created an action that filres an evevent to delete a model in a nested component. It works as expected if you don't require confirmation but not if you do. I've made a loom and a gist of relevent cod below
https://www.loom.com/share/4e90f9619076485f985bb347af83b203?sid=02658892-eccf-4fdf-93a9-0689da4534fe
https://gist.github.com/TomEasterbrook/39ef0038263490bf118b4521cb63ef56
Many thanks
1 replies
Delete Action in a custom livewire component
I am trying to use the Delete action in a custom component action group and although the model get deleted successfully, the component tries to rehydrate itself. and therefore I get a null exception from the component Although I understand this is an expected behaviour in Livewire how can I overcome this to use the action.
I have also trying a plain action to trigger an event but that just gives a 404.when livewire updates
Any help would be awesome
Tom
2 replies
Actions Modal not displayed on Custom Page
I am trying to use Actions on a Custom Page, but the modal does not open. When I use the identical action on a resource page, it operates as expected.
'''php
class ImportCentre extends Page
{
protected static ?string $navigationIcon = 'fas-folder-open';
protected static ?string $navigationGroup = 'System Settings';
protected static string $view = 'filament.pages.import-centre';
public function importHolidayRequestsAction()
{
return ImportAction::make()
->importer(HolidayRequestImporter::class);
}
public function importOvertimeDataAction()
{
return Action::make('overtime_data')
->form([
Select::make('user')
->placeholder('Select a user')
->options(fn () => User::all()->pluck('name', 'id')->toArray())
->required(),
Select::make('year')
->placeholder('Select a year')
->options(function () {
$years = [];
for ($i = 2020; $i <= now()->year; $i++) {
$years[$i] = $i;
}
return $years;
})
->required(),
FileUpload::make('overtime_log')
->label('Upload Overtime Log')
->acceptedFileTypes(['text/csv'])
->panelLayout('compact')
->required()
->disk('s3')
->visibility('private')
->moveFiles()
->directory('overtime_logs')
])->action(fn(array $data) => (new ImportOvertimeDataAction())->handle($data));
}
}
'''
'''html
<x-filament-panels::page>
<div class="flex">
{{$this->importOvertimeDataAction}}
</div>
</x-filament-panels::page>
'''
Any ideas?
Any ideas?
9 replies