Download the PHP package valentin-morice/filament-json-column without Composer
On this page you can find all versions of the php package valentin-morice/filament-json-column. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download valentin-morice/filament-json-column
More information about valentin-morice/filament-json-column
Files in valentin-morice/filament-json-column
Package filament-json-column
Short Description A simple package to view and edit your JSON columns in Filament
License MIT
Homepage https://github.com/valentin-morice/filament-json-column
Informations about the package filament-json-column
filament-json-column
A simple package to view and edit your JSON columns in Filament.
Installation (Stable)
You can install the stable version of the package via composer:
Pre-Release / Dev Version (v3.0)
To try out the upcoming v3.0, compatible with Filament v4, you can require the dev
branch directly.
Thanks to @safwendammak for his pull-request.
Note: This branch is under active development and may contain unstable code.
Add the following to your composer.json
:
Then run composer update
:
Usage
The filament-json-column
plugin works as any other Filament Form Builder or Infolist classes. Make sure the column on which it is called is cast to JSON or array within your Eloquent model.
The form component provides you with two tabs: Viewer
& Editor
. The Viewer
tab pretty prints your JSON data, while the Editor
tab lets you edit it conveniently.
All the methods provided by the plugin accept closures, injected with standard Filament utilities.
Personalize the accent color
The tab selector menu uses the slateblue
CSS color by default. However, you can choose any other color:
Display a single tab
If you'd like to use only one of the tabs, without giving your user the possibility to switch to another, use the following methods:
Change the height
Editor modes
Customize the editor modes. Accepted values (and default) are: ['code', 'form', 'text', 'tree', 'view', 'preview']
Validation
Values are validated as proper JSON by default.
Credits
I've taken inspiration from the following plugins: Pretty JSON & JSONeditor.
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-json-column with dependencies
filament/forms Version ^3.0
filament/notifications Version ^3.3
spatie/laravel-package-tools Version ^1.15.0