Download the PHP package van-ons/laraberg without Composer

On this page you can find all versions of the php package van-ons/laraberg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laraberg

Latest Version License

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

Installation

Install package using composer:

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

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

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

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

Usage

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.

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 inside 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.

Configuration options

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

The options object should be a EditorSettings object.

Models

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

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.

Or by passing the column name to the render method.

Custom Blocks

Gutenberg allows developers to create custom blocks. For information on how to create a custom block you should read the Gutenberg documentation.

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().

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.

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.






All versions of laraberg with dependencies

PHP Build Version
Package Version
Requires embed/embed Version ^3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package van-ons/laraberg contains the following files

Loading the files please wait ....