I am trying to provide some hardcoded data (for the testing purposes only) from my controller like this
return redirect()->route('admin.my-view.edit', $prop)->withToastSuccess('Success')->with(['data' => ['test1', 'test2']]);
And in my edit page I am trying to dump data like this
@dump($data ?? '')
The issue is that I initially get ''
as well as after the redirect.
Am I missing something here?
3
Answers
You are using
with()
function which is a flashed session function and you have to get the the data value like that:Try to use the Redirecting With Flashed Session Data by:
then on blade:
When you do:
in your blade view, you should do: