/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { try { $gallery = Gallery::with('pictures')->findOrFail($id); } catch (Exception $e) { return back()->with('error', trans('default.gallerynotfound')); } $title = $gallery->{'name_' . App::getLocale()}; //$pictures = File::files(base_path() . '/public/images/galleries/' . $gallery->id); return view('galleries.show', compact('title', 'gallery')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { return Gallery::with('GalleryImages')->find($id); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { return Gallery::with('user')->where('id', $id)->first(); }
public function getSingleGallery($id) { $gallery = Gallery::with('user')->where('id', $id)->first(); $gallery->images = $this->getGalleryImageUrls($id, $gallery->id); return $gallery; }