Passport: avoid migrations be migrated

Created on 18 Sep 2016  ·  3Comments  ·  Source: laravel/passport

Do we need all migrations if we just want to use CreateFreshApiToken middleware within our app so we just want to consume our API ?

Most helpful comment

If you just want to use the CreateFreshApiToken middleware, you don't need to run the migrations. Just include the following code in your AppServiceProvider's register method.

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

Also include the middleware in your web middleware group and you will be good to go. As long as you have an authenticated user, you will be given a laravel_token cookie.

All 3 comments

If you just want to use the CreateFreshApiToken middleware, you don't need to run the migrations. Just include the following code in your AppServiceProvider's register method.

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

Also include the middleware in your web middleware group and you will be good to go. As long as you have an authenticated user, you will be given a laravel_token cookie.

@mehranrasulian Hey, if that solved your problem would you mind closing the issue? Thanks!

Sorry, I forgot to close it. Yes, it solved my problem. Thank you!

Was this page helpful?
0 / 5 - 0 ratings