Laraberg Editor

News

April 23rd, 2019

Laraberg Editor

Laraberg is a Laravel package by Maurice Wijnia that aims to provide an easy way to integrate the Gutenberg editor in Laravel projects.

Laraberg aims to provide an easy way to integrate the Gutenberg editor with your Laravel projects. It is built on top of the GutenbergJS project, implements all the necessary communication and adds an easy to use API.

Here’s the basic gist for how you render the editor: first we render/hide an input element:

<input id="[id_here]" type="textarea" name="[name_here]" hidden>

And then we initialize Gutenberg with a helper provided by this package referencing the id attribute from our input:

Laraberg.initGutenberg('[id_here]');

Check out the full installation documentation from the readme for setup and usage instructions. This package simplifies using Gutenberg, but there are a few steps you need to understand to make it work with a Laravel application; for example, Gutenberg requires the following JS libraries: React, React DOM, Moment, and jQuery. You must also configure your models and understand how to get and render the content generated from Gutenberg.

You can learn more about this package and check out the source code on GitHub at VanOns/laraberg.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.