Ejemplo n.º 1
0
 /**
  * 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();
 }
Ejemplo n.º 2
0
 /**
  * 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));
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }