RelationManager on View Resource
When i create a new relation manager and i add it in getRelations array then it automatically is shown on the edit page of my resource and there i can create,edit and delete from this. In the View page the table is shown but without being able to have actions. Is there a way so that i can have also on the View Page the same functionality of the Relation that i have in the Edit Page?
Solution:Jump to solution
@Nikos Koukos I think you need to override the
isReadonly()
method in the relation manager.
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#read-only-mode...6 Replies
Solution
@Nikos Koukos I think you need to override the
isReadonly()
method in the relation manager.
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#read-only-modePerfect @ChesterS this was exactly what i wanted thank you, and maybe you also know how to hide it from the Edit Page and Show it only on the View Page?
I guess one way would be to use
canViewForRecord
and check the class https://filamentphp.com/docs/3.x/panels/resources/relation-managers#conditionally-showing-relation-managers
eg
but I don't know if there's a better way¯\_(ツ)_/¯
thank you very much this worked but need the page class as a string not as a class