【发布时间】:2021-05-01 02:38:27
【问题描述】:
如何从 protected function setupListOperation() 或 CrudController 中的任何其他方法运行 return redirect()->to('/')。
当我检查 CrudController
$this->middleware(function ($request, $next) {
$this->crud = app()->make('crud');
$this->crud->setRequest($request);
$this->setupDefaults();
$this->setup();
$this->setupConfigurationForCurrentOperation();
//COMMENT: as I return from the setupListOperation, then it will run the below return $next.
return $next($request);
});
return $next($request); 不会执行我的 return redirect();
现在我目前的解决方案是die(redirect()->to('/'));,但是下站是页面会显示文字
HTTP/1.0 302 Found Cache-Control: no-cache, private Date: Wed, 27 Jan 2021 09:16:52 GMT Location: http://backpack.test/admin/ Redirecting to http://backpack.test/admin/.
我怎样才能以干净的方式做到这一点?
【问题讨论】: