mvjacobs / laravel-mongodb-passport
A package to allow laravel/passport use with jenssegers/laravel-mongodb
Installs: 20 198
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 1
Requires
- php: >=7.1
- illuminate/support: ^5.5 || ^6.0 || ^7.0 || ^8.0
- jenssegers/mongodb: 3.3.* || 3.4.* || 3.5.* || 3.6.* || 3.7.* || 3.8.*
- laravel/passport: 6.0.* || 7.0.* || 7.4.* || 7.5.* || ^8.0 || ^9.0 || ^10.0
This package is not auto-updated.
Last update: 2024-12-15 05:41:46 UTC
README
A service provider to add support for Laravel Passport and MongoDB.
Table of contents
Installation
Installation using composer:
composer require designmynight/laravel-mongodb-passport
You need to have your App\User
class extend DesignMyNight\Mongodb\Auth\User.php
instead of the default Illuminate\Foundation\Auth\User
. This user class extends larvel-mongodb eloquent user as well as adding all the standard and required authentication and laravel passport traits.
<?php namespace App; use Illuminate\Notifications\Notifiable; use DesignMyNight\Mongodb\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; }
Laravel version Compatibility
And add the service provider in config/app.php
:
DesignMyNight\Mongodb\MongodbPassportServiceProvider::class,
For usage with Lumen, add the service provider in bootstrap/app.php
.
$app->register(DesignMyNight\Mongodb\MongodbPassportServiceProvider::class);
The service provider will overide the default laravel passport models in order to use mongodb's implementation of eloquent. There is no need to register any additional classes or add any additional configuration other than those outlined in Laravel Passport and MongoDB.