在Laravel 5.7中未调用Gate :: before()

时间:2018-11-19 13:17:01

标签: laravel laravel-5.7

即使我的刀片模板中有一个string注释,也不会调用

button

我已经在text内编写了@Input text回调。我已经检查过<app-button [text]="This is a new text">...</app-button> ,它工作正常。

console

为什么不叫error

1 个答案:

答案 0 :(得分:0)

检查中间件的授权策略。具体来说:

'middleware' => ['web', 'admin.verify']

有关Laravel授权中间件的更多信息:https://laravel.com/docs/5.7/authorization#via-middleware

通过链接:

  

Laravel包含一个中间件,该中间件可以在传入请求甚至到达您的路由或控制器之前授权操作。默认情况下,Illuminate\Auth\Middleware\Authorize类中的can中间件被分配了App\Http\Kernel键。

use App\Post;

Route::put('/post/{post}', function (Post $post) {
    // The current user may update the post...
})->middleware('can:update,post');

尝试切换这些设置。

相关问题