How can I run return redirect()->to('/')
from the protected function setupListOperation()
or any other method in CrudController.
As I check 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);
});
the return $next($request);
will not execute my return redirect();
now my current solution is die(redirect()->to('/'));
, but the down site is the page will show the text
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/.
how can I do it in a clean way?
question from:
https://stackoverflow.com/questions/65916137/laravel-backpack-crudcontroller-return-redirect-or-skip-middleware-run-redirec 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…