renamed scope
This commit is contained in:
parent
c4d93754b3
commit
bc2593be4e
@ -21,7 +21,7 @@ class AddAdminItems
|
||||
$attr = ['icon' => ''];
|
||||
|
||||
// Dashboard
|
||||
$dashboards = Dashboard::getByUser($user->id);
|
||||
$dashboards = Dashboard::ofUser($user->id)->get();
|
||||
|
||||
if ($dashboards->count() > 1) {
|
||||
$menu->dropdown(trim(trans_choice('general.dashboards', 2)), function ($sub) use ($user, $attr, $dashboards) {
|
||||
|
@ -35,8 +35,8 @@ class Dashboard extends Model
|
||||
return $this->belongsTo('App\Models\Auth\User', 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function scopeGetByUser($query, $user_id)
|
||||
public function scopeOfUser($query, $user_id)
|
||||
{
|
||||
return $query->where('user_id', $user_id)->get();
|
||||
return $query->where('user_id', $user_id);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user