Package Data | |
---|---|
Maintainer Username: | fengshiyou |
Maintainer Contact: | 501453944@qq.com (fsy) |
Package Create Date: | 2016-12-28 |
Package Last Update: | 2016-12-29 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-10-31 03:02:40 |
Package Statistics | |
---|---|
Total Downloads: | 39 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
laravel开发 常用中间件
配置:
config/union.php
<?php
return [
'mid'=>[
'checkLogin'=>[
'redis'=>'default',//redis库,./app/config/database中redis配置中取值
'token_prefix'=>'tk',//redis中用于token的前缀
'name_param'=>'uid',//用户登陆名
'token_param'=>'token',//用户登陆token
]
]
];
Kernel.php
登陆验证
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
protected $middleware = [
\laravel\MidCheckLogin\CheckLoginMiddleware::class,
];
protected $routeMiddleware = [
];
}
composer.json
composer依赖包
"require": {
"laravel-dev-common/union-middleware":"*",
"laravel-dev-common/union-config":"*",
},