From efc9cd805c8a0501c616a71b460967339a255c07 Mon Sep 17 00:00:00 2001 From: bashman Date: Sun, 20 Oct 2019 16:34:23 -0500 Subject: [PATCH] Added the possibility of placing a -title- in the image tag --- src/LightboxDisplayer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LightboxDisplayer.php b/src/LightboxDisplayer.php index 7cf8efa..d279ce0 100644 --- a/src/LightboxDisplayer.php +++ b/src/LightboxDisplayer.php @@ -48,6 +48,7 @@ public function display(array $options = []) $server = Arr::get($options, 'server'); $width = Arr::get($options, 'width', 200); $height = Arr::get($options, 'height', 200); + $title = Arr::get($options, 'title', ''); $class = Arr::get($options, 'class', 'thumbnail'); $class = collect((array)$class)->map(function ($item) { return 'img-'. $item; @@ -59,7 +60,7 @@ public function display(array $options = []) Admin::script($this->script()); - return collect((array)$this->value)->filter()->map(function ($path) use ($server, $width, $height, $class) { + return collect((array)$this->value)->filter()->map(function ($path) use ($server, $width, $height, $class, $title) { if (url()->isValidUrl($path) || strpos($path, 'data:image') === 0) { $src = $path; } elseif ($server) { @@ -70,7 +71,7 @@ public function display(array $options = []) return << - + HTML; })->implode(' ');