where('rsskey', '=', $passkey)->first(); if ($user) { $this->userID = $id; return true; } return false; } private function getUserData() { $catArray = Rss::select('category')->where('user_id', '=', $this->userID)->first(); if ($catArray) { return explode(',', $catArray); } return []; } private function getTorrents() { $catArray = $this->getUserData(); $torrents = Torrent::select('id', 'name', 'slug', 'size', 'seeders', 'leechers', 'info_hash', 'created_at') ->whereIn('category', $catArray) ->with('category') ->orderBy('created_at', 'DESC') ->take(25)->toArray(); return $torrents; } public function getData($passkey) { if ($this->auth($passkey)) { $torrents = $this->getTorrents(); return Response::view('rss.default', ['passkey' => $passkey, 'torrents' => $torrents])->header('Content-Type', 'text/xml'); } return abort(404); } public function download($passkey, $id) { if ($this->auth($passkey)) { } return abort(404); } public function setView() { redirect(); } public function getView() { $user = Auth::user(); $rssData = RSS::select('category')->where('user_id', '=', $user->id)->first(); $category = Category::select('id', 'name')->get(); } }