backoffice first commit

This commit is contained in:
2026-07-17 11:34:15 +02:00
parent 761db06329
commit 1c40ef6601
159 changed files with 25830 additions and 7875 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
use App\Models\Preventivo;
use App\Support\PreventivoPdf;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
Route::get('/', function () {
return view('welcome');
});
Route::get('/admin/preventivi/{preventivo}/pdf', function (Preventivo $preventivo) {
if (! $preventivo->pdf_path || ! Storage::disk('local')->exists($preventivo->pdf_path)) {
$preventivo->pdf_path = PreventivoPdf::genera($preventivo);
$preventivo->save();
}
return Storage::disk('local')->response(
$preventivo->pdf_path,
'preventivo-'.($preventivo->numero ?? $preventivo->id).'.pdf'
);
})->middleware(['auth'])->name('preventivi.pdf.show');