*/ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; protected $with = [ 'group' ]; /** * Get the group that owns the Role * */ public function group() { return $this->belongsTo(RoleGroup::class, 'group_id', 'id'); } public function company_access() { return $this->hasMany(RoleCompanyAccess::class, 'role_id', 'id'); } }