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
39 lines
1.2 KiB
PHP
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(),
|
|
];
|
|
}
|
|
}
|