Do we need all migrations if we just want to use CreateFreshApiToken middleware within our app so we just want to consume our API ?
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!
Most helpful comment
If you just want to use the
CreateFreshApiTokenmiddleware, you don't need to run the migrations. Just include the following code in yourAppServiceProvider's register method.Also include the middleware in your
webmiddleware group and you will be good to go. As long as you have an authenticated user, you will be given alaravel_tokencookie.