Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

How can I get this link to show up as a link and not as text in Laravel

Here's the way my event is looking:

User generated image
When I enter this info into the database, I'm using TinyMCE with the HTML characters going into the database as regular text.

How can I get my <a href...etc. to display as a link and not as text?
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Hey Bruce,

I'm assuming you're using Blade syntax to output your data. By default, Blade runs data through various filters as a security precaution (such as htmlspecialchars). To avoid that, you need to use a slightly different Blade syntax:

{{!! $yourData !!}}

Open in new window

Note the exclamation marks !
Avatar of Bruce Gust

ASKER

Chris!

When I do this: {{ !! $event_featured->facility !! }}, I get this error:

syntax error, unexpected '!', expecting ')' (View: C:\wamp64\www\new_nomas\resources\views\events_solo.blade.php)

But, to your point, when I do this: <?php echo $event_featured->facility;?>, the link shows up just fine. So, you're absolutely on point as far as what you're talking about with Blade filtering out htmlspecial characters, but I think I'm still doing something wrong.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it!

Thank you!