public function gallery() { $galleries = Gallery::orderBy('id', 'DESC')->paginate(8); $galleries->setPath(''); $setting = Setting::first(); return view('sites.gallery', compact('galleries', 'setting')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $submission = Submission::findOrFail($id); $photoSrc = '/photo_files/normal/' . $submission->photo->file_name; $galleryList = array(); $galleries = Gallery::orderBy('name', 'asc')->get(); foreach ($galleries as $gallery) { $galleryList[strval($gallery->id)] = $gallery->name; } return view('submissions.edit')->with(['submission' => $submission, 'photoSrc' => $photoSrc, 'photoId' => $submission->photo_id, 'galleryList' => $galleryList, 'galleryId' => null]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $title = trans('default.gallery'); $galleries = Gallery::orderBy('position', 'asc')->get(); return view('galleries.index', compact('title', 'galleries')); }