Support the ongoing development of Laravel.io →
posted 1 year ago
0

Actually, I've managed to solve this using what I suspected was the issue. I've just replaced the model.

  1. Created my own model using the uuid trait
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Laravel\Sanctum\PersonalAccessToken as BasePersonalAccessToken;

class PersonalAccessToken extends BasePersonalAccessToken
{
    use HasFactory, HasUuids;
}
  1. updated my service provider to use my model
public function boot(): void
    {
        Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
    }

that worked.. is this the best approach?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Nei Santos nei Joined 15 Aug 2023

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.