Пример #1
0
 /**
  * Display the home page;
  *
  * @return Response
  */
 public function index()
 {
     $photos = [];
     foreach (Photo::all() as $photo) {
         $ratio = $photo->height / $photo->width;
         $displayHeight = 900;
         $photos[] = ['path' => '/photos/' . $photo->name . '?fit=crop&q=80', 'width' => $displayHeight, 'height' => $ratio * $displayHeight];
     }
     return view('pages.home', ['photos' => $photos]);
 }