sfelix-martins / passport-multiauth

Add support to multi-authentication to Laravel Passport
MIT License
288 stars 51 forks source link

ignoreMigrations() doesn't exist anymore #118

Closed juhasev closed 4 years ago

juhasev commented 4 years ago

use SMartins\PassportMultiauth\PassportMultiauth;

PassportMultiauth::ignoreMigrations();

Call to undefined method SMartins\PassportMultiauth\PassportMultiauth::ignoreMigrations()

Sure enough this method doesn't exist in the method. This causes migration to be run on my master database which is a problem because this is a multitenant system.

I am running the latest dev version: smartins/passport-multiauth 6.x-dev 90a72dc

sfelix-martins commented 4 years ago

@juhasev The method ignoreMigrations was added just version to 5.0 here

We need add it to version 6.x too...

juhasev commented 4 years ago

@sfelix-martins I see. That would be fantastic! In the mean time I am just gonna extend your service provider with my own and override registerMigrations() method.

sfelix-martins commented 4 years ago

@juhasev It's a good solution for now. I'm very busy last weeks. I'll try improve some things on weekend!

juhasev commented 4 years ago

Well that worked with very minimal effort! Good to hear! This really should be integrated to passport and a very same way Laravel should support multi-tenancy out of the box!

namespace App\Providers;

use SMartins\PassportMultiauth\Providers\MultiauthServiceProvider;

class PassportMultiAuthServiceProvider extends MultiauthServiceProvider
{
    /**
     * Override register migration from the original package as there is no way
     * to prevent default migrations from running in the master database.
     *
     * Date: 2/7/2020 Feature is implemented in V5 but not yet merged up to V6
     *
     * @return void
     */
    protected function registerMigrations()
    {

    }
}
sfelix-martins commented 4 years ago

@juhasev Solved in https://github.com/sfelix-martins/passport-multiauth/commit/765ffaa0873c41cce0b02959fa1762c802824be8