amaelftah/laravel-trix

How can we render stored content to view?

henryonsoftware opened this issue · 3 comments

I tried this package on Laravel 5.8 but I cannot render content to view.

I tried these methods but it showed an editor with stored content inside:

<!-- inside view blade file -->

@trix($post, 'content')

{!! $post->trix('content') !!} //must use HasTrixRichText trait in order for $model->trix() method work

{!! app('laravel-trix')->make($post, 'content') !!}

What I want is show text only, not show editable editor.

@henryonsoftware i think you can do this $post->content . as long as you don't want to show editor .

Thanks for reply, you are so fast.
I tried but not work!
I think content field does not have in Post table, you only can get it by use Trix instance.
You should write the full document (if possible)

@henryonsoftware yes you are right 👍 . feel free to PR this .