46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\PaymentOrder\PaymentOrders\Pages;
|
|
|
|
use App\Filament\Resources\PaymentOrder\PaymentOrders\Actions\ExportToWord;
|
|
use App\Filament\Resources\PaymentOrder\PaymentOrders\PaymentOrders\PaymentOrderResource;
|
|
use Filament\Actions;
|
|
use Filament\Actions\Action;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditPaymentOrder extends EditRecord
|
|
{
|
|
protected static string $resource = PaymentOrderResource::class;
|
|
|
|
protected function getActions(): array
|
|
{
|
|
return [
|
|
Action::make('Go back')
|
|
->url($this->getResource()::getUrl('index'))
|
|
->icon('heroicon-m-arrow-uturn-left')
|
|
->button()
|
|
->outlined()
|
|
->color('primary'),
|
|
|
|
Action::make('Save')
|
|
->action('save')
|
|
->keyBindings(['mod+s'])
|
|
->icon('heroicon-m-cloud-arrow-up'),
|
|
|
|
Action::make('ExportToWord')
|
|
->icon('heroicon-m-document-arrow-down')
|
|
->color('gray')
|
|
->action(fn () => ExportToWord::make($this->getRecord())->handle()->download()),
|
|
|
|
DeleteAction::make()
|
|
->icon('heroicon-m-trash'),
|
|
];
|
|
}
|
|
|
|
protected function getFormActions(): array
|
|
{
|
|
return []; // necessary to remove the bottom actions
|
|
}
|
|
}
|