I save some HTML Code in my Database. When I got that data to the blade, CSS not working on.
In the Page Source Code I found that < shows as '& lt;'
What method have I to use to convert & lt to <
Is there anybody to help me?
In Laravel, @yield is principally used to define a section in a layout and is constantly used to get content from a child page unto a master page.
Answer: Using htmlspecialchars() function We can remove the HTML special characters from the string using the PHP htmlspecialchars() function. This function converts the HTML special characters within the string into HTML entities. Some most used special characters are: & (ampersand) will be converted to &.
Creating the layout is an important part of any project. Realizing this, Laravel comes with a Blade templating engine which generates HTML based sleek designs and templates. All Laravel views built using Blade are located in resources/views.
Change your syntax from {{ }}
to {!! !!}
that should do the trick
use below code:
{!! htmlspecialchars($post->description)!!}
This will solve your problem.
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