sysvale / laravel-mongodb-passport
一个允许laravel/passport与mongodb/laravel-mongodb一起使用的包
3.0.1
2024-09-11 14:19 UTC
Requires
- php: ^8.1
- laravel/passport: ^10 || ^11
- mongodb/laravel-mongodb: ^4.0
This package is auto-updated.
Last update: 2024-09-11 14:21:23 UTC
README
一个服务提供者,用于添加对Laravel Passport和MongoDB的支持。
目录
安装
使用Composer安装
composer require sysvale/laravel-mongodb-passport
您需要将您的App\User
类扩展为Sysvale\Mongodb\Auth\User.php
,而不是默认的Illuminate\Foundation\Auth\User
。此用户类扩展了larvel-mongodb eloquent用户,并添加了所有标准及必需的认证和Laravel Passport特性。
<?php namespace App; use Illuminate\Notifications\Notifiable; use Sysvale\Mongodb\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; }
Laravel版本兼容性
并在config/app.php
中添加服务提供者
Sysvale\Mongodb\MongodbPassportServiceProvider::class,
服务提供者将覆盖默认的Laravel Passport模型,以便使用MongoDB对eloquent的实现。除了在Laravel Passport和MongoDB中概述的那些之外,无需注册任何其他类或添加任何其他配置。