Hide relationship manager table from Edit view
Hi I want to hide the relationship manager table from the Edit view. I can't find how to do it.
Once a table and form have been defined for the relation manager, visit the Edit or View page of your resource to see it in action.
5 Replies
You want to have the relation manager only on Create?
Only on View. It's a very big form and it won't be necessary to have the realtion table.
I just want to know if it's a way to hide the relation manager table.
I think the simplest way would be to hide it with CSS
Another idea: You could override the
getRelationManagers()
method on the specific page class (eg. EditPost) and return an empty arrayThanks
public static function getRelations(): array
{
if (request()->route()->getName() == 'filament.admin.resources.posts.view') {
return [
RelationManagers\SubmissionsRelationManager::class,
];
}else{
return [];
}
}
I've done this and it's workingFor anyone landing here, this is what I needed to do as the route could be null: