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.racerOP2mo ago
bump!
Solution
toeknee
toeknee2mo 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.racerOP2mo ago
thank you

Did you find this page helpful?