attributes['password'] = bcrypt($password); $this->attributes['password'] = Hash::needsRehash($password) ? Hash::make($password) : $password; } public static function resolve() { return Auth::check() ? Auth::user()->getAuthIdentifier() : null; } public static function resolveId() { return Auth::check() ? Auth::user()->getAuthIdentifier() : null; } public function tags() { return $this->belongsToMany('App\Models\Tag', 'user_tag'); } public function departments() { return $this->belongsToMany('App\Models\Tag', 'user_tag')->where('type', 'abteilung'); } public function instances() { return $this->belongsToMany('App\Models\Tag', 'user_tag')->where('type', 'instanz'); } public function getIsUserAttribute() { return true; } }