81 lines
2.2 KiB
PHP
81 lines
2.2 KiB
PHP
<?php
|
|
|
|
use App\Models\StockBatch;
|
|
use App\Models\StockRoom;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Inertia\Inertia;
|
|
|
|
Route::get('/', function () {
|
|
return Inertia::render('Welcome', [
|
|
'canLogin' => Route::has('login'),
|
|
'canRegister' => Route::has('register'),
|
|
'laravelVersion' => Application::VERSION,
|
|
'phpVersion' => PHP_VERSION,
|
|
]);
|
|
});
|
|
|
|
Route::middleware([
|
|
'auth:sanctum',
|
|
config('jetstream.auth_session'),
|
|
'verified',
|
|
])->group(function () {
|
|
Route::get('/dashboard', function () {
|
|
return Inertia::render('Dashboard');
|
|
})->name('dashboard');
|
|
|
|
// Stock Entries routes
|
|
Route::get('/stock', function () {
|
|
return Inertia::render('StockEntries');
|
|
})->name('stock');
|
|
|
|
// Stock Entries routes
|
|
Route::get('/batches', function () {
|
|
return Inertia::render('StockBatch');
|
|
})->name('batches');
|
|
|
|
// Stock Entries routes
|
|
Route::get('/batchCounting', function (Request $request) {
|
|
return Inertia::render('BatchCounting', [
|
|
'selectedBatch' => StockBatch::with(
|
|
[
|
|
'supplier',
|
|
'stockEntries.physicalItem',
|
|
'stockEntries.supplier',
|
|
// 'stockEntries.attributes',
|
|
'stockEntries.sections',
|
|
'stockEntries.statusHistory',
|
|
'files'
|
|
])->findOrFail($request->get('selectedBatch')),
|
|
]);
|
|
})->name('batchCounting');
|
|
|
|
|
|
|
|
Route::get('/pdaView', function () {
|
|
return Inertia::render('PdaView');
|
|
})->name('pdaView');
|
|
|
|
Route::get('/expediceBatches', function () {
|
|
return Inertia::render('ShippingBatchList');
|
|
})->name('expediceBatches');
|
|
|
|
Route::get('/expedice/{id}', function (Request $request, $id) {
|
|
return Inertia::render('Expedice', [
|
|
'selectedBatchID' => $id
|
|
]);
|
|
})->name('expedice');
|
|
|
|
Route::get('/storageSetup', function () {
|
|
$rooms = StockRoom::with('lines.racks.shelves.positions.sections')->get();
|
|
return Inertia::render('StorageSetup',
|
|
[
|
|
'rooms' => $rooms
|
|
]
|
|
);
|
|
|
|
})->name('storageSetup');
|
|
|
|
});
|