group(function (): void { Route::get('/', function () { return view('welcome'); }); Route::get('/terms', function () { return view('terms'); })->name('terms'); Route::get('/dashboard', function () { return view('dashboard', [ 'counts' => [ 'providers' => ProviderProfile::count(), 'buyers' => BuyerProfile::count(), 'jobs' => JobPost::count(), 'workOrders' => WorkOrder::count(), 'disputes' => Dispute::count(), ], ]); })->middleware(['auth', 'verified'])->name('dashboard'); Route::middleware('auth')->group(function () { Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit'); Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update'); Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); Route::get('/provider-profile', [ProviderProfileController::class, 'edit'])->name('providers.edit'); Route::put('/provider-profile', [ProviderProfileController::class, 'update'])->name('providers.update'); Route::post('/provider-profile/imports', [ExternalProfileImportController::class, 'store'])->name('provider-imports.store'); Route::get('/buyer-profile', [BuyerProfileController::class, 'edit'])->name('buyers.edit'); Route::put('/buyer-profile', [BuyerProfileController::class, 'update'])->name('buyers.update'); Route::post('/feed', [SocialPostController::class, 'store'])->name('feed.store'); Route::post('/comments', [CommentController::class, 'store'])->name('comments.store'); Route::post('/attachments', [AttachmentController::class, 'store'])->name('attachments.store'); Route::delete('/attachments/{attachment}', [AttachmentController::class, 'destroy'])->name('attachments.destroy'); Route::post('/ratings', [RatingController::class, 'store'])->name('ratings.store'); Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.index'); Route::post('/notifications/read-all', [NotificationController::class, 'markAllRead'])->name('notifications.read-all'); Route::post('/notifications/{id}/read', [NotificationController::class, 'markRead'])->name('notifications.read'); Route::get('/jobs/create', [JobPostController::class, 'create'])->name('jobs.create'); Route::post('/jobs', [JobPostController::class, 'store'])->name('jobs.store'); Route::post('/jobs/{job}/quotes', [QuoteController::class, 'store'])->name('quotes.store'); Route::patch('/quotes/{quote}', [QuoteController::class, 'update'])->name('quotes.update'); Route::post('/quotes/{quote}/accept', [QuoteController::class, 'accept'])->name('quotes.accept'); Route::post('/quotes/{quote}/decline', [QuoteController::class, 'decline'])->name('quotes.decline'); Route::get('/work-orders', [WorkOrderController::class, 'index'])->name('work-orders.index'); Route::get('/work-orders/{workOrder}', [WorkOrderController::class, 'show'])->name('work-orders.show'); Route::patch('/work-orders/{workOrder}/transition', [WorkOrderController::class, 'transition'])->name('work-orders.transition'); Route::post('/work-orders/{workOrder}/messages', [WorkOrderMessageController::class, 'store'])->name('work-order-messages.store'); Route::post('/work-orders/{workOrder}/reviews', [ReviewController::class, 'store'])->name('reviews.store'); Route::post('/work-orders/{workOrder}/disputes', [DisputeController::class, 'store'])->name('disputes.store'); Route::get('/disputes/{dispute}', [DisputeController::class, 'show'])->name('disputes.show'); Route::post('/disputes/{dispute}/votes', [DisputeVoteController::class, 'store'])->name('dispute-votes.store'); Route::get('/admin', [AdminController::class, 'index'])->name('admin.index'); }); Route::get('/providers', [ProviderProfileController::class, 'index'])->name('providers.index'); Route::get('/providers/{provider}', [ProviderProfileController::class, 'show'])->name('providers.show'); Route::get('/buyers', [BuyerProfileController::class, 'index'])->name('buyers.index'); Route::get('/buyers/{buyer}', [BuyerProfileController::class, 'show'])->name('buyers.show'); Route::get('/feed', [SocialPostController::class, 'index'])->name('feed.index'); Route::get('/jobs', [JobPostController::class, 'index'])->name('jobs.index'); Route::get('/jobs/{job}', [JobPostController::class, 'show'])->name('jobs.show'); require __DIR__.'/auth.php'; });