首页 > 解决方案 > Laravel 8 护照 UUIDS

问题描述

我刚刚创建了新的 laravel 8 应用程序,但我在使用 Laravel Passport UUIDS 时遇到了一些问题。我已经安装了我需要的一切。更改了每次护照迁移$table->uuid('id')->primary();

一切都是默认的,例如 AuthServiceProvider 只是有Passport::routes();

我尝试按照https://mlo.io/blog/2018/08/17/laravel-passport-uuid/说明进行操作,但似乎不起作用。当我运行时,php artisan passport:install --uuids我收到如下错误:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (SQL: drop table if exists `users`)

是的,我有 user_devices 迁移,我有外国的 oauth_access_tokens,但即使我添加

public function register()
    {
        \Laravel\Passport\Passport::ignoreMigrations();
    }

在 AppServiceProvider 中,它给出了同样的错误。

有人有同样的问题吗?任何相关的教程如何做到这一点?

标签: phplaravel-8

解决方案


推荐阅读