shared dashboards

This commit is contained in:
denisdulici
2020-01-07 17:15:00 +03:00
parent dcab115207
commit 2436898f04
33 changed files with 806 additions and 457 deletions

View File

@ -59,12 +59,7 @@ class User extends Authenticatable
public function dashboards()
{
return $this->hasMany('App\Models\Common\Dashboard');
}
public function widgets()
{
return $this->hasManyThrough('App\Models\Common\Widget', 'App\Models\Common\Dashboard');
return $this->morphToMany('App\Models\Common\Dashboard', 'user', 'user_dashboards', 'user_id', 'dashboard_id');
}
/**