in laravel 5.2.45 session message does not work, how to fix
i am working on a project where its coded in laravel 5.2.45 and i need to have session message but it seems not working and i see nothing wrong in my code but why?
here is my controller code
//first i try it like this as it's working in earlier versions
@if(Session::has('message'))
{!! session('message')!!}
@endif
//then is used this method too but still not working. there is no error message also
@if(Session::has('message'))
{!! Session::get('message')!!}
@endif
Just to debug can you try Session()->put('message', $message) so we can eliminate the possibility of trying to retrieve the data after more than 1 request?
@Cronix - I tested using the helper with capital casing and it works! Am I missing something? If casing was the issue wouldn't he get an error thrown on that line?
@hanif-king if you are saying that put() works but flash() doesn't then it means you are trying to retrieve the message more than one request later.
@ksparkar Maybe your operating system isn't case sensitive, but linux sure is, which is most likely what the os will be for the production site. If you don't follow how things are supposed to be, you'll have a hell of a lot of fixing to do once you push it to a production server. Everything will just break everywhere.