Introduce PDF generation capabilities for shipments using laravel-dompdf. This includes a new service layer, dedicated controller, and routes to handle the generation of Air Waybills (AWB), Invoices, and Shipping Labels. - Add `PdfService` to encapsulate PDF generation logic. - Add `ShipmentPdfController` to handle PDF download requests. - Integrate `barryvdh/laravel-dompdf` dependency. - Add Filament header actions to view shipment pages for quick PDF access. - Update order success view to provide direct download links for documents. - Add label methods to `ShipmentDirection` and `ShipmentType` enums. - Update project status documentation to reflect initial PDF implementation.
20 lines
877 B
PHP
20 lines
877 B
PHP
<?php
|
|
|
|
use App\Http\Controllers\OrderController;
|
|
use App\Http\Controllers\ShipmentPdfController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::get('/', function () {
|
|
return view('welcome');
|
|
});
|
|
|
|
Route::get('/order', [OrderController::class, 'create'])->name('orders.create');
|
|
Route::post('/order', [OrderController::class, 'store'])->name('orders.store');
|
|
Route::get('/order/success/{shipment}', [OrderController::class, 'success'])->name('orders.success');
|
|
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/shipments/{shipment}/pdf/awb', [ShipmentPdfController::class, 'awb'])->name('shipments.pdf.awb');
|
|
Route::get('/shipments/{shipment}/pdf/invoice', [ShipmentPdfController::class, 'invoice'])->name('shipments.pdf.invoice');
|
|
Route::get('/shipments/{shipment}/pdf/label', [ShipmentPdfController::class, 'label'])->name('shipments.pdf.label');
|
|
});
|