jobilla/deprecated-routes-middleware
Composer 安装命令:
composer require jobilla/deprecated-routes-middleware
包简介
A Laravel middleware to mark routes/endpoints as deprecated
README 文档
README
Laravel package to provide a middleware to mark any route as deprecated.
Install
Run the following command in your project folder to add the package to your project.
composer require jobilla/deprecated-routes-middleware
(Optional) Add the following line to $routeMiddleware array in your app/Http/Kernel.php.
'deprecated' => \Jobilla\DeprecatedRoutes\Http\Middlewares\DeprecatedRoute::class,
Usage
Using the middleware on route groups
You can define the deprecation on route group level.
Route::prefix('api/v3') ->middleware('deprecated:2021-03-22') ->group(function () { // Your route definitions here. });
Using the middleware on individual routes
You can define the middleware on a single route.
Route::get('old/endpoint', OldEnpointController::class)->middleware('deprecated:2021-03-22');
Using the middleware on controllers
You can define the middleware inside a controller class.
class OldEnpointController extends Controller { public function __construct() { $this->middleware('deprecated:2021-03-22'); } }
统计信息
- 总下载量: 5.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-27