mafortis
mafortis

Reputation: 7128

Information on laravel API

I need clear information about laravel API.

I've been reading lots of articles about laravel API. Beside choosing between JWT and laravel-passport—which is a whole different level of confusion—I need to get basic information about laravel API to make it clearer to me what's what.

Questions

  1. Why does laravel passport need a database (what's the usage of those tables)?
  2. If I change auth driver to passport in authProvider file, and not use api, would it affect my normal auth behavior?
  3. If i use API (passport) do I have to use laravel-echo or any js library?

Upvotes: 1

Views: 164

Answers (1)

Nikola Kirincic
Nikola Kirincic

Reputation: 3757

Laravel passport needs database to store tokens that are generated and used during authorization. Also, needs to bind these tokens to a specific users.

There are actually 5 new tables that are generated from migrations when installing Laravel Passport:

https://github.com/laravel/passport/tree/7.0/database/migrations

About using Laravel Echo or any js library is optional, and Laravel Passport does not require any of these.

See the Laravel Passport composer.json on requirements and other dependencies:

https://github.com/laravel/passport/blob/7.0/composer.json

Upvotes: 1

Related Questions