setPrefs(); $meta_title = 'My Download Basket'; $meta_keywords = 'search,add,to,cart,download,basket,nzb,description,details'; $meta_description = 'Manage Your Download Basket'; $results = UsersRelease::getCart(Auth::id()); $this->smarty->assign('results', $results); $content = $this->smarty->fetch('cart.tpl'); $this->smarty->assign( [ 'content' => $content, 'meta_title' => $meta_title, 'meta_keywords' => $meta_keywords, 'meta_description' => $meta_description, ] ); $this->pagerender(); } /** * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @throws \Exception */ public function store(Request $request) { $this->setPrefs(); $guids = explode(',', $request->input('id')); $data = Release::getByGuid($guids); if (! $data) { return redirect('/cart/index'); } foreach ($data as $d) { UsersRelease::addCart(Auth::id(), $d['id']); } } /** * @param string|array $id * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @throws \Exception */ public function destroy($id) { $this->setPrefs(); $ids = null; if (! empty($id)) { $ids = explode(',', $id); } elseif (\is_array($id)) { $ids = $id; } if (!empty($ids) && UsersRelease::delCartByGuid($ids, $this->userdata->id)) { return redirect('/cart/index'); } if (! $id) { return redirect('/cart/index'); } return redirect('/cart/index'); } }