changed user company/dashboard check

This commit is contained in:
denisdulici 2020-02-12 17:35:49 +03:00
parent deef3c2076
commit e9ca5114f9

View File

@ -29,9 +29,9 @@ trait Users
return false; return false;
} }
$companies = $user->companies()->pluck('id')->toArray(); $company = $user->companies()->where('id', $id)->first();
return in_array($id, $companies); return !empty($company);
} }
/** /**
@ -49,8 +49,8 @@ trait Users
return false; return false;
} }
$dashboards = $user->dashboards()->pluck('id')->toArray(); $dashboard = $user->dashboards()->where('id', $id)->first();
return in_array($id, $dashboards); return !empty($dashboard);
} }
} }