Fix image error, group images
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tyler 2020-12-27 04:45:36 -05:00
parent e9ea25ad38
commit 85e03a12dc

View File

@ -76,15 +76,16 @@ class MainController extends Controller {
if (!empty($res)) {
if ($images = data_get($res, 'images')) {
$images = array_filter($images, function($item) {
return !empty($item);
});
foreach ($images as $key => $image) {
if (empty($image)) {
continue;
}
$file = $this->downloadFile($image);
$attachment = $book->attach($file, [
'key' => $key
'key' => $key,
'group' => 'images'
]);
$attachment->filename = $key . '.jpg';