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