Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel passport migration not found

I installed laravel passport using command compser require laravel/passsport, but after this, no new migration was made in database/migrations directory. Why is that?

like image 377
Ammar Khan Avatar asked Aug 30 '18 21:08

Ammar Khan


People also ask

Where is laravel Passport token stored?

You can store this token in local storage. This token is also stored in the oauth_access_tokens table. We will be sending a GET request to your URL and we need to send it token as Authorization Header. Above way successive technologies can do API authentication in Laravel Application with a passport.

What is the difference between sanctum and Passport?

@vincent15000 Passport is an OAuth server implementation, and used to offer OAuth authorisation for your application. Sanctum is an authentication library for “simpler” token-based authentication for clients that need it (i.e. mobile apps) but also offers cookie-based authentication for SPAs.


2 Answers

The migration files exist in the Passport package in your vendor directory.

The migrations won't be copied over to your database/migrations folder as they don't need to be since they're registered by the PassportServiceProvider.

You should just be able to run php artisan migrate and they will be included.


If you're using Laravel 5.3 or 5.4 then you will need to register the service provide in your app/config.php file.

like image 196
Rwd Avatar answered Sep 20 '22 22:09

Rwd


Make sure you have PassportServiceProvider registered in config/app.php

// config/app.php

Laravel\Passport\PassportServiceProvider::class,
like image 32
Shimazakhi Avatar answered Sep 17 '22 22:09

Shimazakhi