Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

alaminfirdows/laravel-editorjs

Repository files navigation

image

Laravel-Editor.js

A simple editor.js html parser for Laravel

Latest Version on Packagist Total Downloads

Features

  • Render Editor.js output
  • Custom block rendering

Demo

You can can play with the demo here

Installation

You can install the package via composer:

composer require alaminfirdows/laravel-editorjs

You can publish the config file with:

php artisan vendor:publish --tag="laravel_editorjs-config"

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel_editorjs-views"

Usage

Blade Directive

@editorJsRender($posts->body)

Facade

use App\Models\Post;
$post = Post::find(1);
echo LaravelEditorJs::render($post->body);

Defining An Accessor

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use AlAminFirdows\LaravelEditorJs\Facades\LaravelEditorJs;
class Post extends Model
{
 public function getBodyAttribute()
 {
 return LaravelEditorJs::render($this->attributes['body']);
 }
}
$post = Post::find(1);
echo $post->body;

Versioning

Laravel Version Package Version
10.x, 11.x, 12.x ✅ 2.x
9.x ✅ 1.1
8.x ✅ 1.0

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

AltStyle によって変換されたページ (->オリジナル) /