mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
24 lines
515 B
PHP
24 lines
515 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use App\Models\ModVersion;
|
||
|
use Illuminate\Http\RedirectResponse;
|
||
|
|
||
|
class ModVersionController extends Controller
|
||
|
{
|
||
|
public function show(int $modId, string $version): RedirectResponse
|
||
|
{
|
||
|
$modVersion = ModVersion::where("mod_id", $modId)->where("version", $version)->first();
|
||
|
|
||
|
if ($modVersion == null) {
|
||
|
abort(404);
|
||
|
}
|
||
|
|
||
|
$modVersion->downloads++;
|
||
|
$modVersion->save();
|
||
|
|
||
|
return redirect($modVersion->link);
|
||
|
}
|
||
|
}
|