示例#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();
 }
示例#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));
 }
示例#3
0
 /**
  * Store photo in album
  *
  * @param Album $album
  * @param Photo $photo
  */
 public function storePhotoInAlbum(Album $album, Photo $photo)
 {
     $album->photos()->save($photo);
 }