'datetime', ]; public function roles() { return $this->belongsToMany(Role::class); } public function hasAnyRoles($roles) { return $this->roles()->whereIn('name', $roles)->first() ? true : false; } public function hasRole($role) { return $this->roles()->where('name', $role)->first() ? true : false; } public function members() { return $this->belongsToMany(Member::class, 'member_users'); } public function getIsMemberEditorAttribute() { return $this->members->count() > 0; } public function registerMediaCollections(): void { $this ->addMediaCollection('profile_pics') ->singleFile(); } public function registerMediaConversions(Media $media = null): void { $this->addMediaConversion('thumb') ->width(50) ->height(50); } public function sendPasswordResetNotification($token) { $this->notify(new PasswordResetNotification($token)); } public function getFullNameAttribute() { return "{$this->first_name} {$this->last_name}"; } public function getIsSuperAdminAttribute() { return $this->hasRole('super_admin'); } public function getIsAdminAttribute() { return $this->hasRole('admin'); } public function getIsOperatorAttribute() { return $this->hasRole('operator'); } public function getIsUserAttribute() { return $this->hasRole('user'); } // public function setPasswordAttribute($password) // { // $this->attributes['password'] = bcrypt($password); // } }