table = 'users'; $this->guarded = []; $this->hidden = [ 'password', 'forgot_code', ]; } public static function getTokenByAuth(): string|null { try { $id = auth('admins')->user()->id; return JWTAuth::fromUser(self::find($id)); } catch (\Throwable $th) { return null; } } /** * 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() { return []; } }