dept-eduk/api-force-app-update
Composer 安装命令:
composer require dept-eduk/api-force-app-update
包简介
README 文档
README
This package provides migrations and middleware for locking access to the API where the app version has been blacklisted.
Pulling in with composer:
- Install the package:
composer require e3creative/api-force-app-update
Customisation
The error message given by the middleware is customisable in config/api-force-app-update.php if you publish the
package's config file:
php artisan vendor:publish
How to Use
Add the middleware to the
$routeMiddlewareproperty of yourapp/Http/Kernel.php:/** * 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, ];Add the middleware to the routes you want to protect, or to the
apimiddleware group inKernel.phpif you want it to be applied univerally to theapiroutes.
Route::resource('users', 'UserController')->middleware('force_app_update');
- Run the new migrations with
php artisan migrate - Blacklist versions by adding them into your
blacklisted_versionstable
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-10-31