orderBy('leechers', 'desc')->paginate(50); $deadcount = Torrent::where('seeders', '=', '0')->count(); $time = '2592000'; $tokens = '5'; return view('graveyard.index', compact('dead', 'deadcount', 'user', 'time', 'tokens')); } public function resurrect($id) { $user = Auth::user(); $torrent = Torrent::findOrFail($id); $resurrected = Graveyard::where('torrent_id', '=', $torrent->id)->first(); if ($resurrected) { return Redirect::route('graveyard')->with(Toastr::warning('Torrent Resurrection Failed! This torrent is already pending a resurrection.', 'Yay!', ['options'])); } if ($user->id != $torrent->user_id) { $resurrection = Graveyard::create([ 'user_id' => $user->id, 'torrent_id' => $torrent->id, 'seedtime' => Request::get('seedtime') ]); return Redirect::route('graveyard')->with(Toastr::success('Torrent Resurrection Complete! You will be rewarded automatically once seedtime requirements are met.', 'Yay!', ['options'])); } else { return Redirect::route('graveyard')->with(Toastr::error('Torrent Resurrection Failed! You cannot resurrect your own uploads.', 'Yay!', ['options'])); } } }