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
josef2y ago
Are you on the View page for hte parent record?
fishisushi
fishisushiOP2y ago
Yes Are actions not available on the view page? If so is there a way to override that behavior?
josef
josef2y 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
josef2y ago
but you can change that by implementing isReadOnly() on the relation manager and just returning true
josef
josef2y ago
eh, false of course
fishisushi
fishisushiOP2y ago
Thank you very much!

Did you find this page helpful?