xn/ext-grid-lightbox

Turn your grid into a lightbox & gallery

dev-master 2023-09-12 11:53 UTC

This package is auto-updated.

Last update: 2024-05-12 08:47:00 UTC


README

This is an extension to integrates Magnific Popup into laravel-admin.

Installation

composer require xn/ext-grid-lightbox

php artisan vendor:publish --provider="Xn\Grid\Lightbox\LightboxServiceProvider" --force

Configurations

Open config/admin.php, add configurations that belong to this extension at extensions section.


    'extensions' => [

        'grid-lightbox' => [
        
            // Set to `false` if you want to disable this extension
            'enable' => true,
        ]
    ]

Usage

Use it in the grid:

// lightbox
$grid->column('avatar')->lightbox();

// gallery
$grid->column('avatar')->gallery();

// zoom
$grid->column('avatar')->lightbox(['zooming' => true]);
$grid->column('avatar')->gallery(['zooming' => true]);

// width & height
$grid->column('avatar')->lightbox(['width' => 50, 'height' => 50]);
$grid->column('avatar')->gallery(['width' => 50, 'height' => 50]);

// img class properties
$grid->column('avatar')->lightbox(['class' => 'rounded']);
$grid->column('avatar')->gallery(['class' => ['circle', 'thumbnail']]);

License

Licensed under The MIT License (MIT).