PHPackages                             protrafficgroup/orchid-laraberg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. protrafficgroup/orchid-laraberg

ActiveLibrary[File &amp; Storage](/categories/file-storage)

protrafficgroup/orchid-laraberg
===============================

1.0.x-dev(2y ago)2110MITPHP

Since Oct 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/New1nd/Orchid-Laraberg)[ Packagist](https://packagist.org/packages/protrafficgroup/orchid-laraberg)[ RSS](/packages/protrafficgroup-orchid-laraberg/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laraberg Orchid Laravel
=======================

[](#laraberg-orchid-laravel)

Gutenberg editor for laravel orchid panel
-----------------------------------------

[](#gutenberg-editor-for-laravel-orchid-panel)

Laraberg aims to provide an easy way to integrate the Gutenberg editor with your Laravel projects. It takes the Gutenberg editor and adds all the communication and data it needs function in a Laravel environment.

Table of Contents
==================

[](#table-of-contents-)

- [Installation](#installation)
    - [JavaScript and CSS files](#javascript-and-css-files)
    - [Dependencies](#dependencies)
- [Updating](#updating)
- [Usage](#usage)
    - [Initializing the Editor](#initializing-the-editor)
    - [Configuration options](#configuration-options)
    - [Models](#models)
    - [Custom Blocks](#custom-blocks)
        - [Server-side blocks](#server-side-blocks)
    - [WordPress exports](#wordpress-exports)

Installation
============

[](#installation)

Install package using composer:

```
composer require protrafficgroup/orchid-laraberg
```

Add vendor files to your project (CSS, JS &amp; Config):

```
php artisan vendor:publish --provider="VanOns\Laraberg\LarabergServiceProvider"
```

JavaScript and CSS files
------------------------

[](#javascript-and-css-files)

The package provides a JS and CSS file that should be present on the page you want to use the editor on:

```

```

Dependencies
------------

[](#dependencies)

The Gutenberg editor expects React, ReactDOM, Moment and JQuery to be in the environment it runs in. An easy way to do this would be to add the following lines to your page:

```

```

Updating
========

[](#updating)

When updating Laraberg you have to publish the vendor files again by running this command:

```
php artisan vendor:publish --provider="VanOns\Laraberg\LarabergServiceProvider" --tag="public" --force
```

Usage
=====

[](#usage)

Initializing the Editor
-----------------------

[](#initializing-the-editor)

The Gutenberg editor should replace an existing textarea in a form. On submit the raw content from the editor will be put in the 'value' attribute of this textarea.

```

```

In order to edit content on an already existing model we have to set the value of the textarea to the raw content that the Gutenberg editor provided.

```
{{ $model->content }}
```

To initialize the editor all we have to do is call the initialize function with the id of the textarea. You probably want to do this insde a DOMContentLoaded event.

And that's it! The editor will replace the textarea in the DOM and on a form submit the editor content will be available in the textarea's value attribute.

```
Laraberg.init('[id_here]')
```

Configuration options
---------------------

[](#configuration-options)

The `init()` function takes an optional configuration object which can be used to change Laraberg's behaviour in some ways.

```
const options = {}
Laraberg.init('[id_here]', options)
```

The `options` object should be a EditorSettings object.

```
interface EditorSettings {
    height?: string;
    mediaUpload?: (upload: MediaUpload) => void;
    fetchHandler?: FetchHandler;
    disabledCoreBlocks?: string[];
    alignWide?: boolean;
    supportsLayout?: boolean;
    maxWidth?: number;
    imageEditing?: boolean;
    colors?: Color[];
    gradients?: Gradient[];
    fontSizes?: FontSize[];
}
```

Models
------

[](#models)

In order to add the editor content to a model Laraberg provides the 'RendersContent' trait.

```
use VanOns\Laraberg\Traits\RendersContent;

class MyModel extends Model {
  use RendersContent;
}
```

This adds the `render` method to your model which takes care of rendering the raw editor content. By default the `render` methods renders the content in the `content` column, the column can be changed by changing the `$contentColumn` property on your model to the column that you want to use instead.

```
use VanOns\Laraberg\Traits\RendersContent;

class MyModel extends Model {
  use RendersContent;

  protected $contentColumn = 'my_column';
}
```

Or by passing the column name to the render method.

```
$model->render('my_column');
```

Custom Blocks
-------------

[](#custom-blocks)

Gutenberg allows developers to create custom blocks. For information on how to create a custom block you should read the [Gutenberg documentation.](https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type/)

Registering custom blocks is fairly easy. A Gutenberg block requires the properties `title`, `icon`, and `categories`. It also needs to implement the functions `edit()` and `save()`.

```
const myBlock =  {
  title: 'My First Block!',
  icon: 'universal-access-alt',
  category: 'my-category',

  edit() {
    return Hello editor.
  },

  save() {
    return Hello saved content.
  }
}

Laraberg.registerBlockType('my-namespace/my-block', myBlock)
```

### Server-side blocks

[](#server-side-blocks)

Server-side blocks can be registered in Laravel. You probably want to create a ServiceProvider and register your server-side blocks in it's `boot` method.

```
class BlockServiceProvider extends ServiceProvider {
    public function boot() {
        Laraberg::registerBlockType(
          'my-namespace/my-block',
          [],
          function ($attributes, $content) {
            return view('blocks.my-block', compact('attributes', 'content'));
          }
        );
    }
}
```

WordPress exports
-----------------

[](#wordpress-exports)

Laraberg uses the WordPress Gutenberg packages under the hood, a lot of those packages expose functionality that let's you customize the editor. You can find these packages in Javascript in the global `Laraberg` object.

- `Laraberg.wordpress.blockEditor`
- `Laraberg.wordpress.blocks`
- `Laraberg.wordpress.components`
- `Laraberg.wordpress.data`
- `Laraberg.wordpress.element`
- `Laraberg.wordpress.hooks`
- `Laraberg.wordpress.serverSideRender`

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

924d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43e4020cbf535ac15a745055424de4f1ab99196fc6b19e6cb529c06f2fa5a5da?d=identicon)[Newind](/maintainers/Newind)

---

Top Contributors

[![New1nd](https://avatars.githubusercontent.com/u/10168197?v=4)](https://github.com/New1nd "New1nd (22 commits)")

### Embed Badge

![Health badge](/badges/protrafficgroup-orchid-laraberg/health.svg)

```
[![Health](https://phpackages.com/badges/protrafficgroup-orchid-laraberg/health.svg)](https://phpackages.com/packages/protrafficgroup-orchid-laraberg)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
