The console under console/ has its own session cookie and console guard (UseConsoleSession), so signing out or changing user there leaves the normal interface alone. Links open it in a new window through a one-time handoff key; a signed-out console asks for a PIN code or password on its own login page. Users set their 4-6 digit PIN on the profile's PIN page, and the console's change user dialog takes it on a keypad; five wrong PINs lock PIN sign-in for 15 minutes. Machine counters are cumulative: users record how much a job used and it is added to the latest reading. A maintenance record restarts the whole counter interval from the reading at the record. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
26 lines
1.2 KiB
PHP
26 lines
1.2 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::middleware(['web', 'auth', 'can:machines.use'])
|
|
->prefix('machines')
|
|
->name('machines.')
|
|
->group(function () {
|
|
Route::livewire('/', 'machines::index')->name('index');
|
|
|
|
Route::middleware('can:machines.manage')->group(function () {
|
|
Route::livewire('/create', 'machines::form')->name('create');
|
|
Route::livewire('/{machine}/edit', 'machines::form')->whereNumber('machine')->name('edit');
|
|
Route::livewire('/{machine}/maintenance/create', 'machines::maintenance-item-form')->whereNumber('machine')->name('maintenance.create');
|
|
Route::livewire('/{machine}/maintenance/{item}/edit', 'machines::maintenance-item-form')->whereNumber(['machine', 'item'])->name('maintenance.edit');
|
|
});
|
|
|
|
Route::livewire('/{machine}', 'machines::show')->whereNumber('machine')->name('show');
|
|
});
|
|
|
|
// The console has its own session (Users' UseConsoleSession: paths under console/).
|
|
Route::livewire('/console/machines/{machine}', 'machines::console')
|
|
->middleware(['web', 'auth', 'can:machines.use'])
|
|
->whereNumber('machine')
|
|
->name('machines.console');
|