Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

ajax - how to config role management middleware in laravel

I have some routes use with middleware

here is one example

Route::get('/TobeSubmit', 'AddsController@tobeSubmit')->name('TobeSubmit');

when I use this route outside of middleware its working. here is that middleware

Route::group(['middleware' => ['auth','Admin']],function (){ });

when I use that route inside middleware

Route::group(['middleware' => ['auth','superuser']],function (){
Route::get('/TobeSubmit', 'AddsController@tobeSubmit')->name('TobeSubmit');});

like this, its not working, that route use for data retrieving via AJAX.

question from:https://stackoverflow.com/questions/65600192/how-to-config-role-management-middleware-in-laravel

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The obvious response would be that the middleware is blocking the request, which in this case would mean that the requestor is not an Admin. Unfortunately we would need more information about the request in order to help you further.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...