mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
Reformatted per psr-2 coding standards
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -36,32 +36,32 @@ class GraveyardController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$dead = Torrent::where('seeders', '=', '0')->orderBy('leechers', 'desc')->paginate(50);
|
||||
$deadcount = Torrent::where('seeders', '=', '0')->count();
|
||||
$time = '2592000';
|
||||
$user = Auth::user();
|
||||
$dead = Torrent::where('seeders', '=', '0')->orderBy('leechers', 'desc')->paginate(50);
|
||||
$deadcount = Torrent::where('seeders', '=', '0')->count();
|
||||
$time = '2592000';
|
||||
|
||||
return view('graveyard.index', compact('dead','deadcount','user','time'));
|
||||
return view('graveyard.index', compact('dead', 'deadcount', 'user', 'time'));
|
||||
}
|
||||
|
||||
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']));
|
||||
$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']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user