dimanche 19 août 2018

how to show article comment contains (php codes) as string

hi sorry for my language. im using laravel 5.6 to create a simple article site. i have a problem with show article comments as string. the problem is : laravel try to render php codes and the page give me some errors.

imagine a user wants to send his laravel code as comment to me:

(this is just an example)

@foreach($article->tags as $tag)
<a class="tags" href="/tags/"></a>
@endforeach

if user send this codes as comment to me, my page not loading and give me errors

my code to show comments :

{!!$comment->body !!}

help me please . thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire