What i need is this:
return view('protected.standardUser.includes.documents',compact('documents'))->with('successMsg','Property is updated .');
The i could use it like this:
@if(Session::has('successMsg'))
<div class="alert alert-success"> {{ Session::get('successMsg') }}</div>
@endif
Any suggestion?
Session:Flash Tag Flash data is session data that is only kept for a single request. It is most often used for success/failure messages that automatically disappear after a page refresh.
A flash message is used to communicate back to the user of the website or application that an event has taken place. Often times you'll see a redirect with flash message. This may be something the user intended to do, or it might be something that is just informational.
I order to use session stored flash messages, need to use following code into route method
.
$request->session()->flash('successMsg','Saved succesfully!');
and then do
@if(Session::has('successMsg'))
<div class="alert alert-success"> {{ Session::get('successMsg') }}</div>
@endif
that's it
I'm new in Laravel and I was facing the same issue... I just tried as below::
\Session::flash('flash','Message info');
And it works!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With