sadnub / laravel-tenancy-passport-demo

Laravel demo with Passport and Tenancy
113 stars 32 forks source link

If run "php artisan passport:client" does it work? #5

Closed ramseyjiang closed 5 years ago

ramseyjiang commented 5 years ago

In mine, when I try to create a new client for passport, it's not work.

Illuminate\Database\QueryException : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tenancy.oauth_clients' doesn't exist (SQL: insert into oauth_clients (user_id, name, secret, redirect, personal_access_client, password_client, revoked, updated_at, created_at) values (2, davy, 3okgHsoKaG0HX8CmqZEBn0Izr1symgOjdd5V4a5j, https://xxxx./auth/callback, 0, 0, 0, 2019-01-07 15:15:34, 2019-01-07 15:15:34))

sadnub commented 5 years ago

@davyjiang I'm not migrating passport tables to the tenancy database, just the tenant database. When a tenant is created it will run passport install automatically.

You can modify the AuthServicePovider to allow passport to migrate the tables by removing the line: Passport::ignoreMigrations()

Hope this helps!