Actions not appearing in Relation Manager

I used the provided artisan command to create a relation manager for my users table, but none of the actions included in the boilerplate are appearing on the page. I can add a custom action and it will appear on the RM table - but none of the provided ones render.
public function table(Table $table): Table
{
return $table
->columns(...)
->filters(...)
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
])
->actionsPosition(Tables\Enums\ActionsPosition::BeforeCells)
->poll('120s')
->persistFiltersInSession()
->paginated([10])
->defaultSort('status_changed_at', 'desc');
}
public function table(Table $table): Table
{
return $table
->columns(...)
->filters(...)
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
])
->actionsPosition(Tables\Enums\ActionsPosition::BeforeCells)
->poll('120s')
->persistFiltersInSession()
->paginated([10])
->defaultSort('status_changed_at', 'desc');
}
Solution:
but you can change that by implementing isReadOnly() on the relation manager and just returning true
Jump to solution
6 Replies
josef
josef16mo ago
Are you on the View page for hte parent record?
fishisushi
fishisushiOP16mo ago
Yes Are actions not available on the view page? If so is there a way to override that behavior?
josef
josef16mo ago
yes and yes By default they are not shown, as the assupmtion seems to be that you dont want to edit anything, not even relations
Solution
josef
josef16mo ago
but you can change that by implementing isReadOnly() on the relation manager and just returning true
josef
josef16mo ago
eh, false of course
fishisushi
fishisushiOP16mo ago
Thank you very much!
Want results from more Discord servers?
Add your server