- Fix EventType deletion error handling (constraint violations) - Fix Event update error (package_id column missing) - Fix Event Type dropdown options (JSON display issue) - Fix EventPackagesRelationManager query error - Add missing translations for deletion errors - Apply Pint formatting
36 lines
958 B
PHP
36 lines
958 B
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use App\Models\EventPurchase;
|
|
use Filament\Actions\Exports\Exporter;
|
|
use Filament\Actions\Exports\Models\Export;
|
|
|
|
class EventPurchaseExporter extends Exporter
|
|
{
|
|
public static function getModel(): string
|
|
{
|
|
return EventPurchase::class;
|
|
}
|
|
|
|
public static function getColumns(): array
|
|
{
|
|
return [
|
|
EventPurchase::raw('tenant.name'),
|
|
EventPurchase::raw('package_id'),
|
|
EventPurchase::raw('credits_added'),
|
|
EventPurchase::raw('price'),
|
|
EventPurchase::raw('platform'),
|
|
EventPurchase::raw('purchased_at'),
|
|
EventPurchase::raw('transaction_id'),
|
|
];
|
|
}
|
|
|
|
public static function getCompletedNotificationBody(Export $export): string
|
|
{
|
|
$body = "Your Event Purchases export has completed and is ready for download. {$export->successful_rows} purchases were exported.";
|
|
|
|
return $body;
|
|
}
|
|
}
|