Download the PHP package awcodes/mason without Composer

On this page you can find all versions of the php package awcodes/mason. 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 mason

Mason

A simple block based drag and drop page / document builder field for Filament.

mason opengraph image

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

In an effort to align with Filament's theming methodology you will need to use a custom theme to use this plugin.

[!IMPORTANT] If you have not set up a custom theme and are using a Panel follow the instructions in the Filament Docs first.

  1. Import the plugin's stylesheet into your panel's custom theme css file. This will most likely be at resources/css/filament/admin/theme.css.

  2. Add the plugin's views to your resources/css/filament/admin/tailwind.config.js file.

  3. Rebuild your custom theme.

Configuration

You can publish the config file with:

This is the contents of the published config file:

Usage

[!IMPORTANT] Since Mason uses json to store its data in the database you will need to make sure your model's field is cast to 'array' or 'json'.

Form Field

In your Filament forms you should use the Mason component. The Mason component accepts a name prop which should be the name of the field in your model, and requires an array of actions that make up the 'bricks' available to the editor.

Infolist Entry

In your Filament infolist you should use the MasonEntry component. The Mason component accepts a name prop which should be the name of the field in your model.

To keep from having to repeat yourself when assigning bricks to the editor and the entry it would help to create sets of bricks that make sense for their use case. Then you can just use that in the bricks method.

Creating Bricks

Bricks are nothing more than Filament actions that have an associated view that is rendered in the editor with its data.

To help you get started there is a make:mason-brick command that will create a new brick for you with the necessary class and blade template in the paths specified in the config file.

This will create a new brick in the App\Mason namespace with the class Section and a blade template in the resources/views/mason directory. Bricks follow the same conventions as Filament actions. The important things to note are the fillForm method and the action method. These are how the action interacts with the editor. For bricks that do not have data you can remove the fillForm method and the form method from the brick and it will be inserted into the editor as is.

Rendering Content

You are free to render the content however you see fit. The data is stored in the database as json so you can use the data however you see fit. But the plugin offers a helper method for converting the data to html should you choose to use it.

Similar to the form field and entry components the helper needs to know what bricks are available. You can pass the bricks to the helper as the second argument. See, above about creating a collection of bricks. This will help keep your code DRY.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of mason with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^3.2.139
spatie/laravel-package-tools Version ^1.15.0
stevebauman/hypertext Version ^1.1
ueberdosis/tiptap-php Version ^1.4
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 awcodes/mason contains the following files

Loading the files please wait ....