- Add unified payment provider architecture with contract-based design - Implement 6 payment providers: Stripe, Lemon Squeezy, Polar, Oxapay, Crypto, Activation Keys - Create subscription management with lifecycle handling (create, cancel, pause, resume, update) - Add coupon system with usage tracking and trial extensions - Build Filament admin resources for payment providers, subscriptions, coupons, and trials - Implement payment orchestration service with provider registry and configuration management - Add comprehensive payment logging and webhook handling for all providers - Create customer analytics dashboard with revenue, churn, and lifetime value metrics - Add subscription migration service for provider switching - Include extensive test coverage for all payment functionality
58 lines
1.5 KiB
PHP
58 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Coupons;
|
|
|
|
use App\Filament\Resources\Coupons\Pages\CreateCoupon;
|
|
use App\Filament\Resources\Coupons\Pages\EditCoupon;
|
|
use App\Filament\Resources\Coupons\Pages\ListCoupons;
|
|
use App\Filament\Resources\Coupons\Schemas\CouponForm;
|
|
use App\Filament\Resources\Coupons\Tables\CouponsTable;
|
|
use App\Models\Coupon;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class CouponResource extends Resource
|
|
{
|
|
protected static ?string $model = Coupon::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedTicket;
|
|
|
|
protected static ?string $navigationLabel = 'Coupons';
|
|
|
|
protected static ?string $modelLabel = 'Coupon';
|
|
|
|
protected static ?string $pluralModelLabel = 'Coupons';
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = 'Payment Management';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return CouponForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return CouponsTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListCoupons::route('/'),
|
|
'create' => CreateCoupon::route('/create'),
|
|
'edit' => EditCoupon::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|