diff --git a/UPGRADE.md b/UPGRADE.md index d3ae59bd..b9ff4109 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -139,20 +139,20 @@ If you prefer to use the new structure, you may create a migration to apply the ```php Schema::table('oauth_clients', function (Blueprint $table) { - $table->after('user_id', function (Blueprint $table) { - $table->nullableMorphs('owner'); - }); + $table->nullableMorphs('owner', after: 'user_id'); $table->after('provider', function (Blueprint $table) { $table->text('redirect_uris'); - $table->text('grant_types'); + $table->text('grant_types')->nullable(); }); }); foreach (Passport::client()->cursor() as $client) { Model::withoutTimestamps(fn () => $client->forceFill([ 'owner_id' => $client->user_id, - 'owner_type' => $client->user_id ? config('auth.providers.'.$client->provider.'.model') : null, + 'owner_type' => $client->user_id + ? config('auth.providers.'.($client->provider ?: config('auth.guards.api.provider')).'.model') + : null, 'redirect_uris' => $client->redirect_uris, 'grant_types' => $client->grant_types, ])->save());