Skip to content

Commit 348cf69

Browse files
committed
rollback sanctum tokens
1 parent a1e4091 commit 348cf69

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Providers;
44

55
use App\Helpers\Image;
6+
use App\Helpers\Utils;
67
use Illuminate\Auth\Events\Lockout;
78
use Illuminate\Auth\Notifications\ResetPassword;
89
use Illuminate\Auth\Notifications\VerifyEmail;
@@ -13,6 +14,8 @@
1314
use Illuminate\Support\ServiceProvider;
1415
use Illuminate\Support\Str;
1516
use Illuminate\Validation\ValidationException;
17+
use App\Models\PersonalAccessToken;
18+
use Laravel\Sanctum\Sanctum;
1619

1720
class AppServiceProvider extends ServiceProvider
1821
{
@@ -107,5 +110,9 @@ public function boot(): void
107110
Request::macro('deviceName', function (): string {
108111
return Utils::getDeviceNameFromDetector($this->device());
109112
});
113+
114+
if (config('auth.defaults.guard') === 'api') {
115+
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
116+
}
110117
}
111118
}

0 commit comments

Comments
 (0)