feat: add JailController and bust-out route

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Doar Mihai
2026-06-28 22:49:59 +03:00
co-authored by Claude Sonnet 4.6
parent 799f46a5f2
commit f84a303c76
2 changed files with 48 additions and 2 deletions
+8 -2
View File
@@ -5,6 +5,7 @@ use App\Http\Controllers\Game\CrimeController;
use App\Http\Controllers\Game\DashboardController;
use App\Http\Controllers\Game\GymController;
use App\Http\Controllers\Game\InventoryController;
use App\Http\Controllers\Game\JailController;
use Illuminate\Support\Facades\Route;
/*
@@ -85,7 +86,12 @@ Route::middleware(['auth'])->group(function () {
if (!$character || !$character->isInJail()) {
return redirect()->route('game.dashboard');
}
$releaseTime = $character->in_jail_until ? $character->in_jail_until->diffForHumans() : 'unknown';
return view('game.jail', compact('character', 'releaseTime'));
$releaseTime = $character->in_jail_until ? $character->in_jail_until->diffForHumans() : 'unknown';
$bustOutChance = (int) round((new \App\Services\Game\JailService())->calculateBustOutChance($character) * 100);
$bustOutCost = config('game.jail.breakout_cost', 1000);
return view('game.jail', compact('character', 'releaseTime', 'bustOutChance', 'bustOutCost'));
})->name('game.jail');
Route::post('/game/jail/bust-out', [JailController::class, 'bustOut'])
->name('game.jail.bust-out');
});