p1613m / laravel-editorjs
A simple editor.js html parser for Laravel
v1.0.3
2024-12-13 10:46 UTC
Requires
- php: ^7.2|^8.1
- illuminate/support: ^8.0|^9.0|^10.0
- p1613m/editor.js: 1.0.1
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-04-13 13:05:22 UTC
README
Laravel-Editor.js
A simple editor.js html parser for Laravel
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
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 | Supported |
---|---|
10.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.