to disable view on attach item add this to the resource that want to be disable to view
public function authorizedToView(Request $request)
{
if($request->query->get("viaResource")) {
return false;
}
return true;
}
"$request->query->get("viaResource")" to find if the resource is accessed from other resource
Top comments (0)