// session()->flash("message", "{{ setting('site.contact_success_msg') }}"); //doesn't work
// session()->flash('message', 'Thank you so much for your feedback.'); //works.
session()->flash('message', {!! setting('site.contact_success_msg') !!});//doesn't work
I am trying to show a flash message to the user. I have set the message from Voyager, using Rich text editor to output something like:
Success! Thank you so much for your feedback.
But the above code shows this error message:
Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Parse error: syntax error, unexpected '{'"
Stacktrace:
Could anyone please help?
Thanks in advance!
Ok, I've got it. I used the following code:
session()->flash('message', setting('site.contact_success_msg'));
And then where I flashed the message, I used:
$flash = session('message')
and then showed the output message where I needed using:
{!! $flash !!}
instead of:
{{ $flash }}