SUBD_Transport_Company/routes/web.php
2024-01-30 11:21:30 +04:00

42 lines
1.3 KiB
PHP

<?php
use App\Http\Controllers\CarController;
use App\Http\Controllers\DeliveryController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\WarehouseController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('/', function () {
return redirect()->route('deliveries.index');
});
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
Route::middleware('auth')->group(function () {
Route::resources([
'users' => UserController::class,
'deliveries' => DeliveryController::class,
'warehouses' => WarehouseController::class,
'users.cars' => CarController::class,
]);
Route::put('/deliveries/{delivery}/start', [DeliveryController::class, 'startDelivery'])
->name('deliveries.start');
Route::put('/deliveries/{delivery}/end', [DeliveryController::class, 'endDelivery'])
->name('deliveries.end');
});
require __DIR__.'/auth.php';