RelationshipManager Table Actions.

I've created a relationship manager, with a view page, and applied a table class so it is visible on the parent view component however, the actions don't seem to show at all. I figured it might be to do with authorisation, however, that didn't seem to be the case. Everything but the actions are working as expected.
class AgreementsRelationManager extends RelationManager
{
protected static string $relationship = 'agreements';

protected static ?string $recordTitleAttribute = 'name';

public function table(Table $table): Table
{
return $table

->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('starts_at')->date(),
Tables\Columns\TextColumn::make('ends_at')->date(),
Tables\Columns\TextColumn::make('billing_type')
->badge()
->color(fn (string $state): string => match ($state) {
'fixedfee' => 'gray',
'payg' => 'warning',
'subscription' => 'success',
'prepaid' => 'danger',
}),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
]);
}
}
class AgreementsRelationManager extends RelationManager
{
protected static string $relationship = 'agreements';

protected static ?string $recordTitleAttribute = 'name';

public function table(Table $table): Table
{
return $table

->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('starts_at')->date(),
Tables\Columns\TextColumn::make('ends_at')->date(),
Tables\Columns\TextColumn::make('billing_type')
->badge()
->color(fn (string $state): string => match ($state) {
'fixedfee' => 'gray',
'payg' => 'warning',
'subscription' => 'success',
'prepaid' => 'danger',
}),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
]);
}
}
Solution:
Override isReadOnly() in the Relation Manager to return false.
Jump to solution
2 Replies
Solution
Iliyas M
Iliyas M2y ago
Override isReadOnly() in the Relation Manager to return false.
Aaron Lawrence
Aaron LawrenceOP2y ago
Thank you.

Did you find this page helpful?