コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
 public function getPhoto()
 {
     $photos = ProductPhoto::where('id', '>', '1482')->get();
     foreach ($photos as $key => $value) {
         echo "<img src='{$value->photo_url}' width='360px'>";
     }
 }