コード例 #1
0
 /**
  * Remove the specified photo from the database.
  *
  * @param int $albumId Id of the album
  * @param int $photoId Id of the photo
  * @return \Illuminate\View\View
  */
 public function destroy($albumId, $photoId)
 {
     $photo = \Gallery::photo()->find($photoId);
     \Gallery::photo()->delete($photo);
     $file = "uploads/photos/" . $photo->getFile();
     unlink($file);
     return \Redirect::route("gallery.album.show", ['id' => $albumId])->with('alertsuccess', \Lang::get('gallery::gallery.removal'));
 }
コード例 #2
0
 /**
  * Display the specified albums' photos.
  *
  * @param int $id Id of the album
  * @return \Illuminate\View\View
  */
 public function show($id)
 {
     $album = \Gallery::album()->find($id);
     $albumPhotos = \Gallery::photo()->findByAlbumId($id);
     return view('gallery::album', ['album' => $album, 'albumPhotos' => $albumPhotos]);
 }