0

I'm trying to display HTML if there are any errors.

{{ $errors->has('first_name') ? '<i class="fas fa-exclamation-triangle"></i>' : '' }}

This code shows the "raw" html output and doesn't translate it into code.

Can someone please show me the way? It's for an error validation form.

Thanks.

0

1 Answer 1

2

Use this

{!! $errors->has('first_name') ? '<i class="fas fa-exclamation-triangle"></i>' : '' !!}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, I had the double bang but I used the HTML code as a second parameter to has -_-

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.