mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-28 22:41:13 -05:00
(Update) Graveyard System 🚀
- abilty to cancel a ressurection - cruddy
This commit is contained in:
@@ -149,7 +149,7 @@ class GraveyardController extends Controller
|
||||
*
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function resurrect(Request $request, $id)
|
||||
public function store(Request $request, $id)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
@@ -186,4 +186,23 @@ class GraveyardController extends Controller
|
||||
->with($this->toastr->success('Torrent Resurrection Complete! You will be rewarded automatically once seedtime requirements are met.', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel A Ressurection
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$resurrection = Graveyard::findOrFail($id);
|
||||
|
||||
abort_unless($user->group->is_modo || $user->id === $resurrection->user_id, 403);
|
||||
$resurrection->delete();
|
||||
|
||||
return redirect()->route('graveyard.index')
|
||||
->with($this->toastr->success('Ressurection Successfully Canceled!', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
</p>
|
||||
<div class="btns">
|
||||
<form id="resurrect-torrent" role="form" method="POST"
|
||||
action="{{ route('resurrect', ['torrent_id' => $torrent->id]) }}">
|
||||
action="{{ route('graveyard.store', ['torrent_id' => $torrent->id]) }}">
|
||||
@csrf
|
||||
@if (!$history)
|
||||
<input hidden="seedtime" name="seedtime" id="seedtime"
|
||||
|
||||
@@ -85,9 +85,13 @@
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-danger" @if ($resurrection->rewarded == 1) disabled @endif>
|
||||
<i class="{{ config('other.font-awesome') }} fa-trash"></i>
|
||||
</button>
|
||||
<form action="{{ route('graveyard.destroy', ['id' => $resurrection->id]) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-sm btn-danger" @if ($resurrection->rewarded == 1) disabled @endif>
|
||||
<i class="{{ config('other.font-awesome') }} fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
+3
-2
@@ -295,8 +295,9 @@ Route::group(['middleware' => 'language'], function () {
|
||||
|
||||
// Graveyard System
|
||||
Route::get('/filterGraveyard', 'GraveyardController@faceted');
|
||||
Route::get('/graveyard', 'GraveyardController@index')->name('graveyard');
|
||||
Route::post('/graveyard/{id}', 'GraveyardController@resurrect')->name('resurrect');
|
||||
Route::get('/graveyard', 'GraveyardController@index')->name('graveyard.index');
|
||||
Route::post('/graveyard/{id}', 'GraveyardController@store')->name('graveyard.store');
|
||||
Route::delete('/graveyard/{id}', 'GraveyardController@destroy')->name('graveyard.destroy');
|
||||
|
||||
// Notifications System
|
||||
Route::get('/notifications', 'NotificationController@get')->name('get_notifications');
|
||||
|
||||
Reference in New Issue
Block a user