As a test
get('one', function(){
return redirect('two')->with('title', 'ľščťžýáíé');
});
get('two', function(){
return response()->json(session('title'));
// expected "\u013e\u0161\u010d\u0165\u017e\u00fd\u00e1\u00ed\u00e9"
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys,
I have implemented sweetalert notification system from the Jeff's lesson. However, I am stuck on problem - when I put there characters like this - 'ľščťžýáíé'. I got returned just some code representation of these characters.
This is what my code looks like:
function flash() {
return session()->flash('flash_message', [
'title' => 'šššššš',
'message' => 'message',
'level' => 'info'
]);
}
@if (session()->has('flash_message'))
<script>
swal({
title: 'session output',
text: 'session output',
type: 'session output',
timer: 1700,
showConfirmButton: false
});
</script>
@endif
If put the characters directly to my view, everything is fine. But when I use sessions, it gets wrong. I suppose it does have something with rendering arrays to json, however I could not find the proper function where would I change something.
How should I solve the problem? Thank you
Please or to participate in this conversation.