1. Go to this page and download the library: Download marc-coll/laravel-trix library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
marc-coll / laravel-trix example snippets
Post::create(request()->all());
//storing must follow this convention (model lowered class name)-trixFields
Post::create([
'post-trixFields' => request('post-trixFields'),
]);
<!-- 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') !!}
Post::create(request()->all());
//storing must follow this convention (model lowered class name)-trixFields
//and for attachment must follow attachment-(model lowered class name)-trixFields
Post::create([
'post-trixFields' => request('post-trixFields'),
'attachment-post-trixFields' => request('attachment-post-trixFields')
]);