samuel toh
samuel toh

Reputation: 7086

How can I display the data stored by summernote on laravel?

I implement summernote (https://github.com/summernote/summernote) on the laravel 5.3

If I input data then save, on table seems like this :

<p>1. chelsea</p><p>2. mu</p><p>3. city</p><p>4. liverpool</p><p>5. arsenal</p>

How can I display it without tag p?

So when it displayed will seems like this :

1. chelsea
2. mu
3. city
4. liverpool
5. arsenal

How can I do it?

Upvotes: 0

Views: 4491

Answers (4)

Pushpak
Pushpak

Reputation: 408

Simplest way to show:

<?php echo $variable or html code ; ?>

because in PHP, echo is used to interpret html code.

Upvotes: 1

Balwinder Singh Sohi
Balwinder Singh Sohi

Reputation: 69

@foreach ($GuideCont  as $item )

    <input type="text" value="{{$item->id}}" hidden>
    <div class="card">
        <div class="card-header border-bottom border-info">
            
             <h3 class="card-title">{{$item->title }}</h3>

        </div>
        <div class="card-body">
            {!!$item->description !!}    {{--// SummerNote Data --}}
        </div>
    </div>
    @endforeach

Upvotes: 0

bipin patel
bipin patel

Reputation: 2111

$text = "<p>1. chelsea</p><p>2. mu</p><p>3. city</p><p>4. liverpool</p><p>5. arsenal</p>";
echo strip_tags($text);

Use strip_tags php method to convert html to string. Refernce link

Upvotes: 0

Hedegare
Hedegare

Reputation: 2047

First edit the text accordingly to your desired format inside summernote text editor, and save it.

Then you can use this blade syntax to show the text formated:

{!! message !!}

Upvotes: 5

Related Questions