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