public function restore($id)
 {
     $album = Album::withTrashed()->find($id);
     $photoRepository = \App::make('Repositories\\PhotoRepository');
     $photoRepository->restoreFromAlbum($id);
     return $album->restore();
 }
 /**
  * Show the form for editing the specified photo.
  *
  * @param int $albumId Id of the album
  * @param int $photoId Id of the photo
  * @return \Illuminate\View\View
  */
 public function edit($albumId, $photoId)
 {
     $photo = $this->photo->find($photoId);
     $albumArray = $this->album->all()->toArray();
     foreach ($albumArray as $album) {
         $dropdown[$album['album_id']] = $album['album_name'];
     }
     $data = array('type' => 'photo', 'dropdown' => $dropdown, 'photo' => $photo);
     $this->layout->content = \View::make('gallery::edit', $data)->nest('form', 'gallery::forms.edit-photo', $data);
 }
 /**
  * Remove the specified album from the database.
  *
  * @param int $id Id of the album
  * @return \Illuminate\View\View
  */
 public function destroy($id)
 {
     $this->album->delete($id);
     return \Redirect::route("gallery");
 }
 public function restore($id, PhotoRepository $photos, Filesystem $storage)
 {
     $album = Album::withTrashed()->find($id);
     $photos->restoreFromAlbum($id, $storage);
     return $album->restore();
 }
 /**
  * Listing all albums
  *
  * @return \Illuminate\View\View
  **/
 public function index()
 {
     $allAlbums = $this->album->all();
     $this->layout->content = \View::make('gallery::index', array('allAlbums' => $allAlbums));
 }
 public function delete(Entity\Album $album)
 {
     return Album::withTrashed()->where('id', $album->getId())->forceDelete();
 }