search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $page = Story::pushScope(new RequestScope()) ->pushScope(new StoryPublicScope()) ->select('stories.*') ->paginate($pageLimit) ->withQueryString(); $data = new StoriesCollection($page); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('story::story.names')) ->view('story::public.story.index') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } /** * Show story. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $model = Story::findBySlug($slug); $data = new StoryResource($model); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('story::story.name')) ->view('story::public.story.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }