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]>
42 lines
1.8 KiB
PHP
42 lines
1.8 KiB
PHP
<?php
|
|
|
|
use App\Modules\Inventory\Presentation\Http\Controllers\DownloadInventoryCount;
|
|
use App\Modules\Inventory\Presentation\Http\Controllers\ShowStockItemImage;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
// Pictures on the machine console, which has its own session (paths under console/).
|
|
Route::middleware(['web', 'auth', 'can:inventory.view'])
|
|
->get('/console/inventory/items/{item}/image/{size}', ShowStockItemImage::class)
|
|
->whereNumber('item')
|
|
->whereIn('size', ['full', 'thumbnail'])
|
|
->name('inventory.items.console-image');
|
|
|
|
Route::middleware(['web', 'auth', 'can:inventory.view'])
|
|
->prefix('inventory')
|
|
->name('inventory.')
|
|
->group(function () {
|
|
Route::livewire('/', 'inventory::index')->name('index');
|
|
Route::get('/items/{item}/image/{size}', ShowStockItemImage::class)
|
|
->whereNumber('item')
|
|
->whereIn('size', ['full', 'thumbnail'])
|
|
->name('items.image');
|
|
|
|
Route::middleware('can:inventory.manage')->group(function () {
|
|
Route::livewire('/groups', 'inventory::groups')->name('groups');
|
|
Route::livewire('/items/create', 'inventory::item-form')->name('items.create');
|
|
Route::livewire('/items/{item}/edit', 'inventory::item-form')->whereNumber('item')->name('items.edit');
|
|
});
|
|
|
|
Route::livewire('/items/{item}', 'inventory::item')->whereNumber('item')->name('items.show');
|
|
|
|
Route::middleware('can:inventory.count')->group(function () {
|
|
Route::livewire('/counts', 'inventory::counts')->name('counts');
|
|
Route::livewire('/counts/{count}', 'inventory::count')->whereNumber('count')->name('counts.show');
|
|
});
|
|
|
|
Route::get('/counts/{count}/csv', DownloadInventoryCount::class)
|
|
->whereNumber('count')
|
|
->middleware('can:inventory.manage-counts')
|
|
->name('counts.csv');
|
|
});
|