PHP code example of rrustam / moonshine-editorjs-l12
1. Go to this page and download the library: Download rrustam/moonshine-editorjs-l12 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/ */
rrustam / moonshine-editorjs-l12 example snippets
use App\Models\Post;
use Rrozumbetov\MoonshineEditorJs\Facades\RenderEditorJs;
$post = Post::find(1);
echo RenderEditorJs::render($post->body);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Rrozumbetov\MoonshineEditorJs\Facades\RenderEditorJs;
class Post extends Model
{
public function getBodyAttribute()
{
return RenderEditorJs::render($this->attributes['body']);
}
}
$post = Post::find(1);
echo $post->body;