<?php

use App\Jobs\TestQueueJob;
use App\Models\Transmittal;
use Illuminate\Support\Facades\Route;

Route::redirect('/', '/admin');

Route::view('dashboard', 'dashboard')
    ->middleware(['auth', 'verified'])
    ->name('dashboard');

Route::view('profile', 'profile')
    ->middleware(['auth'])
    ->name('profile');

// Route::get('preview-transmittal', function () {
//     return view('transmittal.export.transmittal-export-table')->with(['transmittals' => Transmittal::withCount(['files', 'notes', 'remarks'])->with(['files' => function ($files) {
//         $files->withCount(['notes', 'remarks']);
//     }])->get()]);
// });

Route::get('queue-test', function () {
    TestQueueJob::dispatch();

    return 'TestQueueJob dispatched';
});

require __DIR__.'/auth.php';
