Tuesday, March 21, 2017

Laravel 5.4 - Redirect back with message

I try to submit a form and redirect back to it after submitting. If the submit was successful, then I want to show a message, e.g. successfully stored data

I tried to redirect back with the message like this:

return redirect()->back()->with("message", "successfully stored data");

However, this does not work.

This is all I get back:

array:4 [▼
  "__env" => Factory {#89 ▶}
  "app" => Application {#3 ▶}
  "errors" => ViewErrorBag {#187 ▶}
  "AllSettings" => Settings {#202 ▶}
]



via Black

Advertisement