repository = $weekly_matching; parent::__construct(); } /** * Show weekly_matching's list. * * @param string $slug * * @return response */ protected function index() { $weekly_matchings = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$weeklymatching::$weekly_matching.names')) ->view('$weeklymatching::public.weekly_matching.index') ->data(compact('$weekly_matchings')) ->output(); } /** * Show weekly_matching's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $weekly_matchings = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$weeklymatching::$weekly_matching.names')) ->view('$weeklymatching::public.weekly_matching.index') ->data(compact('$weekly_matchings')) ->output(); } /** * Show weekly_matching. * * @param string $slug * * @return response */ protected function show($slug) { $weekly_matching = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$weekly_matching->name . trans('$weeklymatching::$weekly_matching.name')) ->view('$weeklymatching::public.weekly_matching.show') ->data(compact('$weekly_matching')) ->output(); } }