findBySlug($slug); if ($game === null) { throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound(); } $deals = $model->dealsFor($slug); $history = $model->historyFor($slug); $similar = $model->similar($game, 8); $bundles = $model->bundlesFor($slug); $franchises = $model->franchisesFor($slug); $subscriptions = Mongo::collection('subscriptions')->find([], ['sort' => ['price' => 1]])->toArray(); $data = [ 'pageTitle' => $game['title'] . ' — best deals — GG.deals', 'game' => $game, 'deals' => $deals, 'history' => $history, 'stores' => (new StoreModel())->map(), 'similar' => $similar, 'bundles' => $bundles, 'franchises' => $franchises, 'subscriptions' => $subscriptions, ]; return view('game', $data); } }