Implement multi-tenancy support with OAuth2 authentication for tenant admins, Stripe integration for event purchases and credits ledger, new Filament resources for event purchases, updated API routes and middleware for tenant isolation and token guarding, added factories/seeders/migrations for new models (Tenant, EventPurchase, OAuth entities, etc.), enhanced tests, and documentation updates. Removed outdated DemoAchievementsSeeder.
This commit is contained in:
38
app/Exports/EventPurchaseExporter.php
Normal file
38
app/Exports/EventPurchaseExporter.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\EventPurchase;
|
||||
use Filament\Actions\Exports\Exporter;
|
||||
use Filament\Actions\Exports\Models\Export;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user