38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Modules\Card\Filament\Actions;
|
|
|
|
use App\Modules\Card\Models\Card;
|
|
use App\Modules\CardTransaction\Repositories\CardTransactionRepository;
|
|
use Filament\Actions\Action;
|
|
use Filament\Forms\Components\DatePicker;
|
|
use Livewire\Component;
|
|
|
|
class DownloadCardTransactionAction
|
|
{
|
|
public static function make(): Action
|
|
{
|
|
return Action::make('card_transactions')
|
|
->label(__('Card transactions'))
|
|
->icon('heroicon-o-arrows-right-left')
|
|
->requiresConfirmation()
|
|
->modalIcon('heroicon-m-arrows-right-left')
|
|
->schema([
|
|
DatePicker::make('start_date')
|
|
->label(__('Start date'))
|
|
->native(false)
|
|
->required()
|
|
->beforeOrEqual('today'),
|
|
|
|
DatePicker::make('end_date')
|
|
->label(__('End date'))
|
|
->native(false)
|
|
->required()
|
|
->beforeOrEqual('today'),
|
|
])
|
|
->action(
|
|
fn (array $data, Card $record, Component $livewire) => CardTransactionRepository::make()->downloadCardTransaction($data, $record, $livewire)
|
|
);
|
|
}
|
|
}
|