中间件

作者: 独步天堂 | 来源:发表于2017-12-10 11:18 被阅读11次

    中间件

    Auth 中间件

    Auth 中间件 必须 书写在控制器的 __construct 方法中,并且

    必须 使用 except 黑名单进行过滤,这样当你新增控制器方法时,默认是安全的。

    public function __construct()
    {
        $this->middleware('auth', [            
            'except' => ['show', 'index']
        ]);
    }
    

    相关文章

      网友评论

          本文标题:中间件

          本文链接:https://www.haomeiwen.com/subject/ucwmixtx.html