mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-21 09:20:08 -05:00
refactor: use route model binding for staff cheated torrents
This commit is contained in:
@@ -64,9 +64,9 @@ class CheatedTorrentController extends Controller
|
||||
/**
|
||||
* Reset the balance of a cheated torrent.
|
||||
*/
|
||||
public function destroy(int $id): \Illuminate\Http\RedirectResponse
|
||||
public function destroy(Torrent $cheatedTorrent): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
Torrent::findOrFail($id)->update([
|
||||
$cheatedTorrent->update([
|
||||
'balance_offset' => DB::raw('balance * -1'),
|
||||
]);
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<menu class="data-table__actions">
|
||||
<li class="data-table__action">
|
||||
<form
|
||||
action="{{ route('staff.cheated_torrents.destroy', ['id' => $torrent->id]) }}"
|
||||
action="{{ route('staff.cheated_torrents.destroy', ['cheatedTorrent' => $torrent]) }}"
|
||||
method="POST"
|
||||
>
|
||||
@csrf
|
||||
|
||||
+1
-1
@@ -733,7 +733,7 @@ Route::middleware('language')->group(function (): void {
|
||||
Route::prefix('cheated-torrents')->group(function (): void {
|
||||
Route::name('staff.cheated_torrents.')->group(function (): void {
|
||||
Route::get('/', [App\Http\Controllers\Staff\CheatedTorrentController::class, 'index'])->name('index');
|
||||
Route::delete('/{id}', [App\Http\Controllers\Staff\CheatedTorrentController::class, 'destroy'])->name('destroy');
|
||||
Route::delete('/{cheatedTorrent}', [App\Http\Controllers\Staff\CheatedTorrentController::class, 'destroy'])->name('destroy');
|
||||
Route::delete('/', [App\Http\Controllers\Staff\CheatedTorrentController::class, 'massDestroy'])->name('massDestroy');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user