HTML in DB with Laravel 5.8

Asked

Viewed 68 times

1

I have several fields on a page that use ckeditor:

<label for="PublicoAlvo">Público Alvo</label>
<textarea name="publico_alvo" id="PublicoAlvo" rows="10" cols="80">
    Coloque aqui o Público Alvo do Curso
</textarea>

<script>
   CKEDITOR.replace( 'publico_alvo' );
</script>

He is carrying too many resources and wanted only the basics: Alignment and formatting for example. The case is that I put any formatting, write to the database and display everything as text. Stack type this to post questions. :)

Example:

<p>Esse curso é para pessoas que já estão no ensino <b>superior</b></p>  

In the controller so sending you:

$curso->publico_alvo = $request->input('publico_alvo');

How do I record in the correct way or show only the text with the page reading the html inlaid?

  • It should be recording correctly, at the time of showing that you should use {!! !!} ... its I am not mistaken.

  • Helped you answer?

  • Helped @Virgilionovic! Thank you so much

  • is now displaying plain text without HTML. But it is not interpreting HTML. Example: I have a list of 5 options. It lists one below the other but does not mark the list. Strong is also not applying.

1 answer

1

  • is now displaying plain text without HTML. But it is not interpreting HTML. Example: I have a list of 5 options. It lists one below the other but does not mark the list. Strong is also not applying.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.