Looking to hire Laravel developers? Try LaraJobs

webdecero-package-laravel-passport maintained by webdecero

Description
Enable use of laravel/passport with mongodb/laravel-mongodb
Author
Last update
2024/11/07 15:58 (dev-main)
License
Links
Downloads
15

Comments
comments powered by Disqus

Patch Laravel Passport (Laravel + MongoDB + Passport)

Enable use of laravel/passport with mongodb/laravel-mongodb

Table of contents

Installation

Make sure you have the MongoDB PHP driver installed. You can find installation instructions at:

Requeriments

PHP extension

  • php: ^8.1

WARNING: The old mongo PHP driver is not supported.

Laravel version Compatibility

Laravel Package Passport
10.x 1.x 11.10.*
11.x 2.x 12.x

Installation using composer:

composer require webdecero/webdecero-package-laravel-passport

Optional Add the service provider to config/app.php:

Webdecero\Laravel\Passport\PassportServiceProvider::class

Configuration

In this new major release which supports the new mongodb PHP extension, we also moved the location of the Model class and replaced the MySQL model class with a trait.

Env File


DB_CONNECTION=mongodb
DB_HOST=localhost
DB_AUTHENTICATION_DATABASE=**your database authentication, for global authentication use admin**
DB_DATABASE=**your database**
DB_USERNAME=**your username**
DB_PASSWORD=**your password**
DB_PORT=27017