Support the ongoing development of Laravel.io →
API Sanctum Laravel
Last updated 6 months ago.
0

The problem was that I am using uuid for my users table and personal_access_tokens table is morphable with id so I changed it to uuidMorphs and now it's working

Schema::create('personal_access_tokens', function (Blueprint $table) {
  $table->bigIncrements('id');
  $table->uuidMorphs('tokenable');
  $table->string('name');
  $table->string('token', 64)->unique();
  $table->text('abilities')->nullable();
  $table->timestamp('last_used_at')->nullable();
  $table->timestamps();
});
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Robert N robertnicjoo Joined 19 Jul 2017

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.