From f8a247f0d017eb05830cc720fb621401b1bfbc2c Mon Sep 17 00:00:00 2001 From: z-song Date: Fri, 11 Oct 2019 14:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9laravel=206.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 1 - src/LightboxDisplayer.php | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index adeb840..24a28ee 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,6 @@ "providers": [ "Encore\\Grid\\Lightbox\\LightboxServiceProvider" ] - } } } diff --git a/src/LightboxDisplayer.php b/src/LightboxDisplayer.php index c18b405..7cf8efa 100644 --- a/src/LightboxDisplayer.php +++ b/src/LightboxDisplayer.php @@ -4,6 +4,8 @@ use Encore\Admin\Admin; use Encore\Admin\Grid\Displayers\AbstractDisplayer; +use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Support\Arr; use Illuminate\Support\Facades\Storage; class LightboxDisplayer extends AbstractDisplayer @@ -43,15 +45,15 @@ public function display(array $options = []) $this->value = $this->value->toArray(); } - $server = array_get($options, 'server'); - $width = array_get($options, 'width', 200); - $height = array_get($options, 'height', 200); - $class = array_get($options, 'class', 'thumbnail'); + $server = Arr::get($options, 'server'); + $width = Arr::get($options, 'width', 200); + $height = Arr::get($options, 'height', 200); + $class = Arr::get($options, 'class', 'thumbnail'); $class = collect((array)$class)->map(function ($item) { return 'img-'. $item; })->implode(' '); - if (array_get($options, 'zooming')) { + if (Arr::get($options, 'zooming')) { $this->zooming(); }