stephanus-tantiono / json-column-for-backpack
A Json Column column for Backpack
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 2
Language:Blade
Requires
- backpack/crud: ^4.1.0|^5.0
This package is auto-updated.
Last update: 2025-06-23 11:09:36 UTC
README
This package provides an advanced json
column type for the Backpack for Laravel administration panel. The main features as opposed to Backpack's stock json
column are that:
- you can expand and collapse values in the json keys;
- the keys and values are of a different colours;
If your JSON is small, the json
column in backpack core is likely sufficient for your needs. But if you have a large JSON, this column will really shine.
Screenshots
Installation
Via Composer
composer require stephanus-tantiono/json-column-for-backpack
Usage
Inside your custom CrudController:
$this->crud->addColumn([ 'name' => 'column_name', 'type' => 'view', 'view' => 'json-column-for-backpack::columns.json', ]);
Overwriting
If you need to change the column in any way, you can easily publish the file to your app, and modify that file any way you want. But please keep in mind that you will not be getting any updates.
Step 1. Copy-paste the blade file to your directory:
# create the columns directory if it's not already there mkdir -p resources/views/vendor/backpack/crud/columns # copy the blade file inside the folder we created above cp -i vendor/stephanus-tantiono/json-column-for-backpack/src/resources/views/columns/json.blade.php resources/views/vendor/backpack/crud/columns/json_viewer.blade.php
Step 2. Load the published file instead of the one in the vendor directory:
$this->crud->addColumn([ 'name' => 'column_name', 'type' => 'json_viewer', ]);
Step 3. Uninstall this package. Since it only provides one file - json.blade.php
, and you're no longer using that file, it makes no sense to have the package installed:
composer remove stephanus-tantiono/json-column-for-backpack
Change log
Please see the changelog for more information on what has changed recently.
Security
If you discover any security related issues, please email the author instead of using the issue tracker.
Credits
- Steve for creating this column
- ziming for supervising
- Cristian Tabacitu for creating backpack and troubleshooting issues with the column not loading correctly in the package
- Roman Makudera for creating json-viewer
License
MIT. Please see the license file for more information.