dept-eduk / api-force-app-update
此软件包最新版本(2.0.0)没有提供许可证信息。
2.0.0
2019-10-31 09:53 UTC
This package is not auto-updated.
Last update: 2024-09-28 07:28:47 UTC
README
此软件包提供迁移和中间件,用于锁定访问已列入黑名单的应用版本API。
使用Composer拉取
- 安装软件包:
composer require e3creative/api-force-app-update
自定义
如果发布软件包的配置文件: php artisan vendor:publish
,则可以在 config/api-force-app-update.php
中自定义中间件提供的错误消息。
如何使用
将中间件添加到您的
app/Http/Kernel.php
中的$routeMiddleware
属性。/** * The application's route middleware. * * These middleware may be assigned to groups or used individually. * * @var array */ protected $routeMiddleware = [ ..., 'force_app_update' => \E3Creative\ApiForceAppUpdate\Middleware\ForceUpdate::class, ];
将中间件添加到您想保护的路由中,或者如果要将它应用于所有
api
路由,请添加到Kernel.php
中的api
中间件组。
Route::resource('users', 'UserController')->middleware('force_app_update');
- 使用
php artisan migrate
运行新的迁移。 - 通过将它们添加到您的
blacklisted_versions
表中,来列入黑名单版本。