Krzysztof
Krzysztof
FFilament
Created by Krzysztof on 8/18/2024 in #❓┊help
Testing formActions
I have a following footer actions:

->footerActions([
fn (string $operation): Action => Action::make('saveBasicDetails')
->label('Save changes')
->action(function (Section $component, EditRecord $livewire) {
$livewire->saveFormComponentOnly($component);

Notification::make()
->title('Basic details saved')
->success()
->send();
})
->visible($operation == 'edit'),
])

->footerActions([
fn (string $operation): Action => Action::make('saveBasicDetails')
->label('Save changes')
->action(function (Section $component, EditRecord $livewire) {
$livewire->saveFormComponentOnly($component);

Notification::make()
->title('Basic details saved')
->success()
->send();
})
->visible($operation == 'edit'),
])
Is there a way to test it? It is inside a section of the form
2 replies
FFilament
Created by Krzysztof on 8/1/2024 in #❓┊help
Tailwind class "!" prefix removed when using Panel from custom package
No description
20 replies
FFilament
Created by Krzysztof on 5/20/2024 in #❓┊help
Hide navigation item but redirect to it when switching tenants
I have a multi-tenant app with mostly custom pages (outside of multi-tenancy, regular routes/web.php pages). When I switch tenants I have to save it to the database. But without any tenant-aware pages I do not have access to the new tenant. What I found out is that Filament is redirecting users to the first navigation item that is visible. I've created a tenant-aware page as a hack, that saves the current tenant in the mount method and redirects the user to other non-tenant page. The problem is, it needs to be present in the navigation which is not going to happen. I've also tried custom navigation builder, but it also gets the first visible item. Have anyone done something similar or is there a better way to save a tenant after switch?
3 replies