我的中间件应使用restric_desc =撤消学生门户访问权限来阻止用户。但这最终阻止了所有用户访问该标签。
Route::group(['middleware' => ['auth'], 'request' =>App\Models\BlockReason::where('IS_ACTIVE','0')->pluck('ID')], function () {
Route::group(['middleware' => 'block', 'request' => App\Models\BlockRestricType::where('RESTRIC_DESC', 'Revoke Student Portal Access')->pluck('ID')],function(){
我的中间件
public function handle($request, Closure $next)
{
$var= $request->route()->getAction();
if($request->IS_ACTIVE != 0){
if($request->RESTRIC_DESC == 'Revoke Student Portal Access'){
return redirect('/');
}
}
return $next($request);
}