CreateAction not showing in relation manager table header action in view page

So i have this Relation Manager with the following code
CreateAction::make()
->action(function (RelationManager $livewire, array $data): Model {
return $livewire->getRelationship()->create($data);
}),
CreateAction::make()
->action(function (RelationManager $livewire, array $data): Model {
return $livewire->getRelationship()->create($data);
}),
On edit page i can see this table header action on the relation manager, but on view page the action is not visible. I tried to attach a ->visible(true) at the end of it and it still doesn't help too
3 Replies
pocket.racer
pocket.racerOP2w ago
bump!
Solution
toeknee
toeknee2w ago
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#read-only-mode add:
public function isReadOnly(): bool
{
return false;
}
public function isReadOnly(): bool
{
return false;
}
in the relationshipmanager
pocket.racer
pocket.racerOP2w ago
thank you
Want results from more Discord servers?
Add your server