src/Grid/Displayers/Carousel.php 1 location
|
@@ 24-30 (lines=7) @@
|
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
$images = collect((array) $this->value)->filter()->map(function ($path) use ($server) { |
| 24 |
|
if (url()->isValidUrl($path) || strpos($path, 'data:image') === 0) { |
| 25 |
|
$image = $path; |
| 26 |
|
} elseif ($server) { |
| 27 |
|
$image = rtrim($server, '/').'/'.ltrim($path, '/'); |
| 28 |
|
} else { |
| 29 |
|
$image = Storage::disk(config('admin.upload.disk'))->url($path); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
$caption = ''; |
| 33 |
|
|
src/Grid/Displayers/Image.php 1 location
|
@@ 17-23 (lines=7) @@
|
| 14 |
|
} |
| 15 |
|
|
| 16 |
|
return collect((array) $this->value)->filter()->map(function ($path) use ($server, $width, $height) { |
| 17 |
|
if (url()->isValidUrl($path) || strpos($path, 'data:image') === 0) { |
| 18 |
|
$src = $path; |
| 19 |
|
} elseif ($server) { |
| 20 |
|
$src = rtrim($server, '/').'/'.ltrim($path, '/'); |
| 21 |
|
} else { |
| 22 |
|
$src = Storage::disk(config('admin.upload.disk'))->url($path); |
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
return "<img src='$src' style='max-width:{$width}px;max-height:{$height}px' class='img img-thumbnail' />"; |
| 26 |
|
})->implode(' '); |
src/Grid/Displayers/Downloadable.php 1 location
|
@@ 21-27 (lines=7) @@
|
| 18 |
|
return ''; |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
if (url()->isValidUrl($value)) { |
| 22 |
|
$src = $value; |
| 23 |
|
} elseif ($server) { |
| 24 |
|
$src = rtrim($server, '/').'/'.ltrim($value, '/'); |
| 25 |
|
} else { |
| 26 |
|
$src = Storage::disk(config('admin.upload.disk'))->url($value); |
| 27 |
|
} |
| 28 |
|
|
| 29 |
|
$name = basename($value); |
| 30 |
|
|