From 463be45fb18b6cc58481c204653c4847aa3436d5 Mon Sep 17 00:00:00 2001 From: Natanael Sinisalo Date: Fri, 24 May 2024 12:37:15 +0300 Subject: [PATCH] Change SanctumTokens component to use getMorphClass instead of get_class to query tokens correctly when using morphMap --- src/Livewire/SanctumTokens.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Livewire/SanctumTokens.php b/src/Livewire/SanctumTokens.php index f75a558..78963a0 100644 --- a/src/Livewire/SanctumTokens.php +++ b/src/Livewire/SanctumTokens.php @@ -37,7 +37,7 @@ protected function getTableQuery(): Builder return app(Sanctum::$personalAccessTokenModel)->where([ ['tokenable_id', '=', $auth->id()], - ['tokenable_type', '=', get_class($auth->user())], + ['tokenable_type', '=', $auth->user()->getMorphClass()], ]); }