Optimise invoice data requests #56

This commit is contained in:
2025-11-18 10:27:49 +01:00
parent 387c3be93a
commit 93f7871c18
14 changed files with 308 additions and 972 deletions
+38 -42
View File
@@ -3,59 +3,55 @@
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use App\Http\Controllers\InvoiceController;
use Illuminate\Support\Facades\Log;
use App\Http\Controllers\CustomerController;
Route::get('/', function () {
return Inertia::render('Dashboard');
})->middleware(['auth', 'verified'])->name('home');
Route::middleware('auth')->group(function () {
Route::get('dashboard', function () {
return Inertia::render('Dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
// Dashboard
Route::get('/', function () {
return Inertia::render('Dashboard');
})->name('home');
Route::get('crm', function () {
return Inertia::render('CRM');
})->middleware(['auth', 'verified'])->name('crm');
Route::get('dashboard', function () {
return Inertia::render('Dashboard');
})->name('dashboard');
Route::get('offers', function () {
return Inertia::render('Offers');
})->middleware(['auth', 'verified'])->name('offers');
// CRM
Route::get('crm', function () {
return Inertia::render('CRM');
})->name('crm');
Route::get('customers', function () {
return Inertia::render('Customers');
})->middleware(['auth', 'verified'])->name('customers');
// Offers
Route::get('offers', function () {
return Inertia::render('Offers');
})->name('offers');
Route::get('leads', function () {
return Inertia::render('Leads');
})->middleware(['auth', 'verified'])->name('leads');
// Customers
Route::get('customers', [CustomerController::class, 'show'])->name('customers');
Route::get('achievements', function () {
return Inertia::render('Achievements');
})->middleware(['auth', 'verified'])->name('achievements');
// Leads
Route::get('leads', function () {
return Inertia::render('Leads');
})->name('leads');
Route::get('invoices', function () {
return Inertia::render('Invoices');
})->middleware(['auth', 'verified'])->name('invoices');
// Achievements
Route::get('achievements', function () {
return Inertia::render('Achievements');
})->name('achievements');
Route::get('invoices?action=new', function () {
return Inertia::render('Invoices');
})->middleware(['auth', 'verified'])->name('newInvoice');
// Invoices
Route::get('invoices', [InvoiceController::class, 'show'])->name('invoices');
Route::get('invoices?action=new', [InvoiceController::class, 'show'])->name('newInvoice');
Route::get('invoice/{id}', [InvoiceController::class, 'preview'])->name('invoicePreview');
Route::get('invoice/{id}/pdf', [InvoiceController::class, 'exportPdf'])->name('invoiceExportPdf');
Route::get('invoice/{id}/xml', [InvoiceController::class, 'exportXml'])->name('invoiceExportXml');
Route::get('invoice/{id}', [InvoiceController::class, 'preview'])
->middleware(['auth', 'verified'])
->name('invoice.preview');
// Timesheets
Route::get('timesheets', function () {
return Inertia::render('Timesheets');
})->name('timesheets');
});
Route::get('invoice/{id}/pdf', [InvoiceController::class, 'exportPdf'])
->middleware(['auth', 'verified'])
->name('invoice.exportPdf');
Route::get('invoice/{id}/xml', [InvoiceController::class, 'exportXml'])
->middleware(['auth', 'verified'])
->name('invoice.exportXml');
Route::get('timesheets', function () {
return Inertia::render('Timesheets');
})->middleware(['auth', 'verified'])->name('timesheets');
require __DIR__ . '/settings.php';
require __DIR__ . '/auth.php';