Auth 中间件必须书写在控制器的 __construct 方法中,并且必须使用 except 黑名单进行过滤,这样当你新增控制器方法时,默认是安全的。
__construct
except
public function __construct() { $this->middleware('auth', [ 'except' => ['show', 'index'] ]); }