public function all() { $collection = []; $all = Album::all(); foreach ($all as $album) { $collection[$album->id] = $this->fromEloquent($album); } return Collection::make($collection); }
/** * 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); }
public function all() { return Album::all(); }
/** * Listing all albums * * @return \Illuminate\View\View **/ public function index() { $allAlbums = $this->album->all(); $this->layout->content = \View::make('gallery::index', array('allAlbums' => $allAlbums)); }