grid lightbox & gallery

师曦
2023-12-01

安装

composer require laravel-admin-ext/grid-lightbox

php artisan vendor:publish --tag=laravel-admin-grid-lightbox

配置

config/admin.php:

'extensions' => [

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

用法:

// simple lightbox
$grid->picture()->lightbox();

//gallery
$grid->picture()->gallery();

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

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

//img class properties
$grid->picture()->lightbox(['class' => 'rounded']);
$grid->picture()->gallery(['class' => ['circle', 'thumbnail']]);
 类似资料: