id); $images = []; foreach ($query->get() as $image) { $images[] = [ 'id' => $image->id, 'url' => $image->getUrl(Image::SMALL), 'filename' => $image->filename ]; } return Response::json($images, 200); } }