- Hours the counter reading cannot parse (",5") no longer fail after
they are saved; they just get no hour counter suggestion.
- The console's sign-in falls back to a console machine list
(machines::console-picker at /console/machines) instead of /machines,
so it stays in the console's own session.
- Recording counter usage locks the counter first, so usage saved at
the same time from two devices is not lost.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
25 lines
1.1 KiB
PHP
25 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Modules\Users\Presentation\Http\Middleware\UseConsoleSession;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
use Illuminate\Http\Request;
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
->withRouting(
|
|
web: __DIR__.'/../routes/web.php',
|
|
commands: __DIR__.'/../routes/console.php',
|
|
health: '/up',
|
|
)
|
|
->withMiddleware(function (Middleware $middleware): void {
|
|
// The machine console has its own session and sign-in page.
|
|
$middleware->redirectGuestsTo(fn (Request $request) => UseConsoleSession::isConsole($request) ? route('console.login') : route('login'));
|
|
$middleware->redirectUsersTo(fn (Request $request) => UseConsoleSession::isConsole($request) ? route('machines.console-picker') : route('home'));
|
|
})
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
|
$exceptions->shouldRenderJsonWhen(
|
|
fn (Request $request) => $request->is('api/*') || $request->expectsJson(),
|
|
);
|
|
})->create();
|