/** * Display a listing of the Tracking. * * @param Request $request * @return Response */ public function index(Request $request) { $this->trackingRepository->orderBy('id', 'desc')->pushCriteria(new RequestCriteria($request)); $location_id = $request->location_id; if (empty($location_id)) { $trackings = $this->trackingRepository; } else { $trackings = $this->trackingRepository->locatedAt($location_id); } $trackings = $trackings->with('location')->with('billboardOwner')->with('product')->with('brand')->with('facing')->with('user')->paginate(25); $locations = Location::lists('city', 'id'); return view('trackings.index')->with('trackings', $trackings)->with('locations', $locations)->with('location_id', $location_id); }
/** * Show the form for editing the specified Billboard. * * @param int $id * * @return Response */ public function edit($id) { $billboard = $this->billboardRepository->findWithoutFail($id); $billboard_owners = BillboardOwner::lists('name', 'id'); $locations = Location::lists('city', 'id'); if (empty($billboard)) { Flash::error('Billboard not found'); return redirect(route('billboards.index')); } return view('billboards.edit', compact('billboard', 'billboard_owners', 'locations')); }