Laravel5's session always convert tags to HTML entity
This is enough to spend my times whereas I only need to store HTML tags in the session flashdata. Unlike L4, L5 always convert all of my tags to the HTML entity. This is my code :
return redirect('/')->with('login_fail', '<div class="notif error">Wrong NIK & Password combination!</span>');
Same result here with static function
Session::flash('login_fail', '<div class="notif error">Wrong NIK & Password combination!</span>');
return redirect('/');
Ouch sorry, I don't know how can I wrote a closing span, yes it should be </div>. I will fix it.
And great, by using {!! $login_fail !!} it works for me thanks!
At first I thought L5 session caused this thing. I mean, they always convert tags into html entity.
<div class="notif error"><p>Wrong NIK & Password combination!</p></div>
... with {{ session('login_fail') }} for echoing my flashdata.
In short, escaping data prevents the string from being treated "as code". So in your case, we're saying it's okay for the server to render your string as a div. If it was escaped (i.e. {{ $login_fail }}), it'd be treated and displayed as plain text - not code. Google and read up on malicious SQL injections. Should give you a good idea on what escaping data is (not directly related to this, but same principles apply).
@aldiunanto If the answer solved your problem, please mark it as accepted.