belongsTo(RoleProxy::modelClass()); } /** * Checks if admin has permission to perform certain action. * * @param String $permission * @return Boolean */ public function hasPermission($permission) { if ($this->role->permission_type == 'custom' && ! $this->role->permissions) { return false; } return in_array($permission, $this->role->permissions); } /** * Send the password reset notification. * * @param string $token * @return void */ public function sendPasswordResetNotification($token) { $this->notify(new AdminResetPassword($token)); } /** * Create a new factory instance for the model. * * @return AdminFactory */ protected static function newFactory(): AdminFactory { return AdminFactory::new(); } /** * Get the identifier that will be stored in the subject claim of the JWT. * * @return mixed */ public function getJWTIdentifier() { return $this->getKey(); } /** * Return a key value array, containing any custom claims to be added to the JWT. * * @return array */ public function getJWTCustomClaims(): array { return []; } }