简体   繁体   中英

Laravel Redirect does not work

I'll try to redirect with a message in a normal Laravel 5.2 controller but this still doesn't work. I don't know why, because in a other controller it works. This is the controller who's not working: 在此处输入图片说明

And this is the controller who's working: 在此处输入图片说明

Have anyone an idea why this doesn't redirect? I haven't any errors or something. It does simply nothing.

Thank you!

Try this:

return redirect()->back()->with('message', 'Your message');

Or try to use \\Redirect instead of Redirect if you want to use facade.

Try use global namespace in first case

return \Redirect::back();

or use helper function

return redirect()->back();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM