Closed Alyka closed 7 months ago
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.
Sanctum Version
4.x
Laravel Version
10.x
PHP Version
8.x
Database Driver & Version
No response
Description
Overriding the default model throws an error
Laravel\\Sanctum\\NewAccessToken::__construct(): Argument #1 ($accessToken) must be of type Laravel\\Sanctum\\PersonalAccessToken, Core\\Models\\SanctumModel given, called in /var/www/html/vendor/laravel/sanctum/src/HasApiTokens.php on line 52
Steps To Reproduce
Sanctum::usePersonalAccessTokenModel(SanctumModel::class);
use
theLaravel\Sanctum\HasApiTokens
trait in your User model$user->createToken('token_name')