/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function getShow($id) { $filename = PostDados::select('photo')->where('id', $id)->get(); $file = Storage::get('img\\' . $filename[0]->photo); $response = Response::make($file, 200); $response->header('Content-Type', 'image/jpg'); return $response; }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function postUpdate(Request $request, $id) { $formdata = $request->all(); $post = new PostDados($formdata); PostDados::where('id', $id)->update(['aperture' => $post->aperture, 'exposure_time' => $post->exposure_time, 'iso' => $post->iso, 'camera' => $post->camera, 'focal_length' => $post->focal_length]); return redirect('posts/'); }