Code Monkey home page Code Monkey logo

laravel-editorjs's Introduction

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

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, 11.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.

laravel-editorjs's People

Contributors

alaminfirdows avatar syahid-dev avatar widiu7omo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-editorjs's Issues

Laravel 9 and PHP 8

Hello,

It looks like this package could not be installed with Laravel 9 et PHP 8 ?

Tks, Denis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.