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");
And in the view...
@if(isset($message))
<center><p> {{ $message }} </p></center>
@endif
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 ▶}
]