Hintergründe zum EventInvitePage Layout Customizer hinzugefügt. Badge und CTA entfernt, Textfelder zu Textareas gemacht. Geschenkgutscheine verbessert, E-Mail-Versand ergänzt + Resend + Confirmationseite mit Code-Copy und Link zur Package-Seite, die den Code als URL-Parameter enthält.
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
namespace App\Filament\Resources\GiftVoucherResource\Pages;
|
||||
|
||||
use App\Filament\Resources\GiftVoucherResource;
|
||||
use App\Services\GiftVouchers\GiftVoucherService;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ListGiftVouchers extends ListRecords
|
||||
{
|
||||
@@ -11,6 +16,55 @@ class ListGiftVouchers extends ListRecords
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [];
|
||||
return [
|
||||
Action::make('issue')
|
||||
->label('Gutschein ausstellen')
|
||||
->icon('heroicon-o-plus')
|
||||
->form([
|
||||
TextInput::make('amount')
|
||||
->label('Betrag')
|
||||
->numeric()
|
||||
->required(),
|
||||
TextInput::make('currency')
|
||||
->label('Währung')
|
||||
->default('EUR')
|
||||
->maxLength(3)
|
||||
->required(),
|
||||
TextInput::make('purchaser_email')->label('E-Mail Käufer')->required(),
|
||||
TextInput::make('recipient_email')->label('E-Mail Empfänger'),
|
||||
TextInput::make('recipient_name')->label('Name Empfänger'),
|
||||
TextInput::make('message')
|
||||
->label('Nachricht')
|
||||
->maxLength(500),
|
||||
TextInput::make('code')
|
||||
->label('Code (optional)')
|
||||
->placeholder('GIFT-'.Str::upper(Str::random(8))),
|
||||
Placeholder::make('code_hint')
|
||||
->label('')
|
||||
->content('Wenn kein Code eingetragen wird, erzeugen wir automatisch einen eindeutigen Gutscheincode.'),
|
||||
])
|
||||
->action(function (array $data, GiftVoucherService $service): void {
|
||||
$payload = [
|
||||
'id' => null,
|
||||
'metadata' => [
|
||||
'type' => 'gift_voucher',
|
||||
'purchaser_email' => $data['purchaser_email'],
|
||||
'recipient_email' => $data['recipient_email'] ?? null,
|
||||
'recipient_name' => $data['recipient_name'] ?? null,
|
||||
'message' => $data['message'] ?? null,
|
||||
'gift_code' => $data['code'] ?? null,
|
||||
],
|
||||
'currency_code' => $data['currency'] ?? 'EUR',
|
||||
'totals' => [
|
||||
'grand_total' => [
|
||||
'amount' => (float) $data['amount'],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$service->issueFromPaddle($payload);
|
||||
})
|
||||
->modalHeading('Geschenkgutschein ausstellen'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user