コード例 #1
0
 public function addPhoto($zip, $street, Request $request)
 {
     $this->validate($request, ['photo' => 'required|mimes:jpg,jpeg,png,bmp']);
     $photo = Photo::fromfile($request->file('photo'))->upload();
     Flyer::LocatedAt($zip, $street)->addPhoto($photo);
     /*
        if (! $this->userCreateFlyer($request)) {
     
             return $this->unauthorized($request);
        }
     
     
        $photo = $this->makePhoto($request->file('photo'));
     
        Flyer::LocatedAt($zip ,$street) ->addPhoto($photo);
     */
 }
コード例 #2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($zip, $street)
 {
     //return Flyer::LocatedAt($zip ,$street)->first();
     $flyer = Flyer::LocatedAt($zip, $street)->first();
     return view('flyers.show', compact('flyer'));
 }