/** * Remove the specified album from the database. * * @param int $id Id of the album * @return \Illuminate\View\View */ public function destroy($id) { $album = new Entity\Album(); $album->map(['id' => $id]); \Gallery::album()->delete($album); return \Redirect::route("gallery")->with('alertsuccess', \Lang::get('gallery::gallery.removal')); }
/** * 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 = \Gallery::photo()->find($photoId); $albumArray = \Gallery::album()->all()->toArray(); foreach ($albumArray as $album) { $dropdown[$album->getId()] = $album->getName(); } $data = array('type' => 'photo', 'dropdown' => $dropdown, 'photo' => $photo); return view('gallery::edit', $data)->with('form', 'gallery::partials.edit-photo'); }
/** * Show a list of all the albums. * * @return \Illuminate\View\View */ public function index() { $allAlbums = \Gallery::album()->all(); return view('gallery::index', ['allAlbums' => $allAlbums]); }