J. Doe
J. Doe

Reputation: 1009

How to prevent escaping a blade syntax?

I wanted to use the helper to set an e-mail address:

Email: contact@{{ request()->getHost() }}

But apparently, @ before {{ is used to escape Blade instructions!

How can we prevent this escaping functionality?

Upvotes: 2

Views: 67

Answers (1)

Amit Senjaliya
Amit Senjaliya

Reputation: 2945

You should use @ as a string:

Email: contact{{ '@'. $request()->getHost() }}

Upvotes: 2

Related Questions