/** * Store a newly created resource in storage. * * @param $album_id * @param Request $request * @param PhotoForm $photoForm * @return Response */ public function store($album_id, Request $request, PhotoForm $photoForm) { $photoForm->validate($request->only('photo')); $album = Album::findOrFail($album_id); $photo = Photo::fromForm($request->file('photo'), $album->name); $this->albumRepo->storePhotoInAlbum($album, $photo); return back(); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $album = Album::findOrFail($id); return View('users.albums.album-show', array('album' => $album)); }
/** * Attach share album to pivot * * @param Request $input * @return mixed */ public function shareAlbumWith($input) { $album = Album::findOrFail($input['album_id']); $album->sharedWith()->attach(array_values($input['shareWith'])); return $album; }