feat: clean credits users
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BillingProducts\Pages;
|
||||
|
||||
use App\Filament\Resources\BillingProducts\BillingProductResource;
|
||||
use App\Services\StripeBillingProductSyncer;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBillingProduct extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BillingProductResource::class;
|
||||
|
||||
protected function afterCreate(): void
|
||||
{
|
||||
app(StripeBillingProductSyncer::class)->sync($this->record);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BillingProducts\Pages;
|
||||
|
||||
use App\Filament\Resources\BillingProducts\BillingProductResource;
|
||||
use App\Services\StripeBillingProductSyncer;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBillingProduct extends EditRecord
|
||||
{
|
||||
protected static string $resource = BillingProductResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
BillingProductResource::syncStripeAction(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function afterSave(): void
|
||||
{
|
||||
app(StripeBillingProductSyncer::class)->sync($this->record);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BillingProducts\Pages;
|
||||
|
||||
use App\Filament\Resources\BillingProducts\BillingProductResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBillingProducts extends ListRecords
|
||||
{
|
||||
protected static string $resource = BillingProductResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user