Change the active relation manager tab

Is there a way of accessing the parent Resource from inside a RelationManager? E.g I want to change the tab after this action has been called but > Property [$parent] not found on component
->bulkActions([
Tables\Actions\DeleteBulkAction::make()
->after(function (ProductsRelationManager $livewire, Tables\Actions\DeleteBulkAction $action) {
$livewire->parent->activeRelationManager = array_key_first($livewire->parent->getRelationManagers());
}),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make()
->after(function (ProductsRelationManager $livewire, Tables\Actions\DeleteBulkAction $action) {
$livewire->parent->activeRelationManager = array_key_first($livewire->parent->getRelationManagers());
}),
])
I found $livewire->getPageClass() but this only returns the string
4 Replies
exactwebitesolutions
Thanks but no I need to access the Resource page instead of the model. Bump - still trying to find a solution
Patrick Boivin
Patrick Boivin14mo ago
Have you tried emiting a Livewire event? You can emit from your DeleteBulkAction and handle the event in the parent Page component.
exactwebitesolutions
Was hoping Filament with Livewire v3 had a cool way of handling this using the new 'parent' without an event
Want results from more Discord servers?
Add your server