stayallive/laravel-passport-memoized
最新稳定版本:v1.0.6
Composer 安装命令:
composer require stayallive/laravel-passport-memoized
包简介
Laravel Passport memoized repositories.
README 文档
README
Laravel Passport comes with repositories for the underlying oauth2-server that result in multiple queries to retrieve the same exact object from the database in a single request. With a good database engine this will have a small impact in the range of milliseconds but this is still unacceptable and should be avoided if possible.
With a typical Passport token authenticated request you will see that the token is retrieved 3 times and the client is retrieved twice.
This might be patched in future Laravel Passport releases, but until that time you can install this package.
This package replaces the client and token repositories with ones that memoize the results of certain calls that perform database queries to remove the duplicate queries.
It's safe to use with Laravel Octane since we make sure that the memoize cache is cleared after each request to prevent stale caches.
Why a package?
And not a PR to Laravel Passport? This was attempted (although not a perfect solution yet) in the past but it was decided to not be changed so this package was created as an alternative. See also this pinned issue for more information and another package if you are looking for an alternative solution.
Installation
composer require stayallive/laravel-passport-memoized
Usage
You should only have to install this package to benefit, unless you have disable package auto discovery, in that case you will need to add the service provider to
your config/app.php manually.
Security Vulnerabilities
If you discover a security vulnerability within this package, please send an e-mail to Alex Bouma at alex+security@bouma.me. All security vulnerabilities will be swiftly
addressed.
License
This package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 13.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-30