public function deleted() { trust()->permissions(false); }
public function deleted() { trust()->roles(true); }
/** * @return \Illuminate\Database\Eloquent\Collection|\Znck\Trust\Contracts\Role[] */ public function getRoles() { if (!is_null($this->cached_roles)) { return $this->cached_roles; } $this->load('roles'); /** @var \Illuminate\Support\Collection $names */ /** @noinspection PhpUndefinedFieldInspection */ $names = $this->roles->pluck('slug', 'id'); return $this->cached_roles = trust()->roles()->filter(function ($role) use($names) { return $names->has($role->id); }); }