From 5843c34240f3a9a7927b4e9ac5ddd619ce376f24 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 13 Sep 2021 02:34:01 -0600 Subject: [PATCH] fix type error with WebauthnKeyTransformer --- app/Http/Controllers/Api/Client/WebauthnController.php | 2 ++ app/Transformers/Api/Client/WebauthnKeyTransformer.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/Client/WebauthnController.php b/app/Http/Controllers/Api/Client/WebauthnController.php index 3e3aad679..bc4eb82ef 100644 --- a/app/Http/Controllers/Api/Client/WebauthnController.php +++ b/app/Http/Controllers/Api/Client/WebauthnController.php @@ -87,6 +87,8 @@ class WebauthnController extends ClientApiController $request->input('name'), ); + + return $this->fractal->item($webauthnKey) ->transformWith(WebauthnKeyTransformer::class) ->toArray(); diff --git a/app/Transformers/Api/Client/WebauthnKeyTransformer.php b/app/Transformers/Api/Client/WebauthnKeyTransformer.php index 062adb9fb..07c47875e 100644 --- a/app/Transformers/Api/Client/WebauthnKeyTransformer.php +++ b/app/Transformers/Api/Client/WebauthnKeyTransformer.php @@ -17,8 +17,10 @@ class WebauthnKeyTransformer extends Transformer /** * Return basic information about the currently logged in user. + * + * @param \Pterodactyl\Models\WebauthnKey|\LaravelWebauthn\Models\WebauthnKey $model */ - public function transform(WebauthnKey $model): array + public function transform($model): array { return [ 'id' => $model->id,