Laravel Passport UUID

大家好, 我有个 laravel passport UUID user_id 问题,users table 我使用了 UUID
代码如下:

    Schema::create('users', function (Blueprint $table) {
        $table->uuid('id')->primary()->unique();
        $table->string('name');
        $table->string('email')->unique();
        $table->timestamp('email_verified_at')->nullable();
        $table->string('password');
        $table->rememberToken();
        $table->timestamps();
    });

然后我的 CreateOauthClientsTable 代码如下:

 Schema::create('oauth_clients', function (Blueprint $table) {
        $table->uuid('id')->primary();
        $table->uuid('user_id')->index()->nullable();
        $table->string('name');
        $table->string('secret', 100);
        $table->text('redirect');
        $table->boolean('personal_access_client');
        $table->boolean('password_client');
        $table->boolean('revoked');
        $table->timestamps(); 
    });

当我获取到 user_id 如果 前面是数字就写进去,如果是字母就不能识别, 我也不知道具体什么原因,

网上搜索了几天,还是没有头绪, 大家有没有遇过这个问题 , 可以帮忙指点一二吗, 在这里先谢过了。

微信号:liyong6336

暂时没有作品
JasonLi9168
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 1

貌似laravel8 已经完美支持了 uuid,刚才看了下。还没升级,没测试。

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!