ifnex/04_Laravel/app/Filament/Resources/ShipmentResource/Pages/ViewShipment.php
Kazem Alghasi a973c7ed5c feat(ui): add invoice download action to shipment view
Add a new 'download_invoice' action to the ViewShipment Filament page, allowing users to download invoices directly from the shipment details view.

refactor(shipping): remove redundant Persian comments from import classes
2026-08-23 23:35:12 +03:30

39 lines
1.2 KiB
PHP

<?php
namespace App\Filament\Resources\ShipmentResource\Pages;
use App\Filament\Resources\ShipmentResource;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;
class ViewShipment extends ViewRecord
{
protected static string $resource = ShipmentResource::class;
protected function getHeaderActions(): array
{
return [
Actions\Action::make('print_label')
->label('چاپ لیبل')
->icon('heroicon-o-printer')
->color('success')
->url(fn ($record) => route('shipments.pdf.label', $record))
->openUrlInNewTab(),
Actions\Action::make('download_awb')
->label('دانلود AWB')
->icon('heroicon-o-document-text')
->color('warning')
->url(fn ($record) => route('shipments.pdf.awb', $record))
->openUrlInNewTab(),
Actions\Action::make('download_invoice')
->label('دانلود INVOICE')
->icon('heroicon-o-currency-dollar')
->color('info')
->url(fn ($record) => route('shipments.pdf.invoice', $record))
->openUrlInNewTab(),
];
}
}