Introduce a shipment status history system to audit status changes, including the reason for change and the user responsible. This includes a new `ShipmentStatusHistory` model and a bulk action in the Filament ShipmentResource to transition statuses. Enhance the rate import workflow by adding a downloadable Excel template and refactoring the `ImportRatesPage` to use the modern Filament form schema. - Add `ShipmentStatusHistory` model and migration - Add bulk `changeStatus` action to `ShipmentResource` - Add `source` field to tracking events - Implement `ShippingRatesTemplateExport` for rate template downloads - Refactor `ImportRatesPage` form implementation and UI - Add `statusHistories` relationship to `Shipment` model
45 lines
1.8 KiB
PHP
45 lines
1.8 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\OrderController;
|
|
use App\Http\Controllers\PricingPageController;
|
|
use App\Http\Controllers\ShipmentPdfController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::get('/', function () {
|
|
return view('welcome');
|
|
});
|
|
|
|
Route::get('/pricing', PricingPageController::class)->name('pricing.index');
|
|
|
|
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');
|
|
});
|
|
|
|
// صفحات نتیجه پرداخت
|
|
Route::get('/payment-result', function (Illuminate\Http\Request $request) {
|
|
$status = $request->input('status');
|
|
$transactionId = $request->input('transaction_id');
|
|
$refId = $request->input('ref_id');
|
|
$amount = $request->input('amount');
|
|
$message = $request->input('message');
|
|
|
|
$isSuccess = $status === 'success';
|
|
|
|
return view('payment-result', [
|
|
'status' => $status,
|
|
'isSuccess' => $isSuccess,
|
|
'transactionId' => $transactionId,
|
|
'refId' => $refId,
|
|
'amount' => $amount,
|
|
'message' => $message,
|
|
]);
|
|
})->name('payment.result');
|
|
Route::get('/download-rate-template', function () {
|
|
return (new \App\Exports\ShippingRatesTemplateExport)->download('IFNEX_Rate_Template.xlsx');
|
|
})->middleware(['auth', 'panel:admin'])->name('download.rate-template'); |