/** * Render the product photos * * @param integer $productId * @param string $type * @return mixed */ public function getProductPhoto($productId, $type = 'front') { $photo = ProductPhoto::where(['product_id' => $productId, 'type' => $type])->first(); if ($photo === null) { return Response::make('', 404); } return Image::make(Storage::disk('s3')->get($photo->location))->response(); }
public function getPhoto() { $photos = ProductPhoto::where('id', '>', '1482')->get(); foreach ($photos as $key => $value) { echo "<img src='{$value->photo_url}' width='360px'>"; } }