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