anonymous widget

This commit is contained in:
denisdulici
2020-01-16 14:20:08 +03:00
parent 8e6e5049e7
commit d129d04ffd
3 changed files with 31 additions and 12 deletions

View File

@ -16,7 +16,7 @@ class Widget extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'dashboard_id', 'class', 'name', 'settings', 'sort'];
protected $fillable = ['company_id', 'dashboard_id', 'class', 'name', 'sort', 'settings'];
/**
* The attributes that should be casted to native types.
@ -32,8 +32,8 @@ class Widget extends Model
return $this->belongsTo('App\Models\Common\Dashboard');
}
public function user()
public function users()
{
return $this->hasOneThrough('App\Models\Auth\User', 'App\Models\Common\Dashboard');
return $this->hasManyThrough('App\Models\Auth\User', 'App\Models\Common\Dashboard');
}
}