init
This commit is contained in:
232 files changed
+25416
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests;
|
||||
|
||||
use App\Filament\Resources\BazaarApiRequests\Pages\ListBazaarApiRequests;
|
||||
use App\Filament\Resources\BazaarApiRequests\Pages\ViewBazaarApiRequest;
|
||||
use App\Filament\Resources\BazaarApiRequests\Schemas\BazaarApiRequestForm;
|
||||
use App\Filament\Resources\BazaarApiRequests\Schemas\BazaarApiRequestInfolist;
|
||||
use App\Filament\Resources\BazaarApiRequests\Tables\BazaarApiRequestsTable;
|
||||
use App\Models\BazaarApiRequest;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BazaarApiRequestResource extends Resource
|
||||
{
|
||||
protected static ?string $model = BazaarApiRequest::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Cafe Bazaar';
|
||||
|
||||
protected static ?string $navigationLabel = 'API activity';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BazaarApiRequestForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return BazaarApiRequestInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BazaarApiRequestsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBazaarApiRequests::route('/'),
|
||||
'view' => ViewBazaarApiRequest::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarApiRequests\BazaarApiRequestResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBazaarApiRequest extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BazaarApiRequestResource::class;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarApiRequests\BazaarApiRequestResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBazaarApiRequest extends EditRecord
|
||||
{
|
||||
protected static string $resource = BazaarApiRequestResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarApiRequests\BazaarApiRequestResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBazaarApiRequests extends ListRecords
|
||||
{
|
||||
protected static string $resource = BazaarApiRequestResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarApiRequests\BazaarApiRequestResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewBazaarApiRequest extends ViewRecord
|
||||
{
|
||||
protected static string $resource = BazaarApiRequestResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarApiRequestForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarApiRequestInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('operation')->badge(),
|
||||
TextEntry::make('method')->badge(),
|
||||
TextEntry::make('url')->columnSpanFull(),
|
||||
TextEntry::make('status_code'),
|
||||
IconEntry::make('successful')->boolean(),
|
||||
TextEntry::make('duration_ms')->suffix(' ms'),
|
||||
TextEntry::make('request_metadata')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
TextEntry::make('response_body')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
TextEntry::make('error_message')->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarApiRequests\Tables;
|
||||
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\TernaryFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BazaarApiRequestsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('operation')->badge()->searchable()->sortable(),
|
||||
TextColumn::make('method')->badge(),
|
||||
TextColumn::make('status_code')->label('Status')->sortable(),
|
||||
IconColumn::make('successful')->boolean(),
|
||||
TextColumn::make('duration_ms')->label('Duration')->suffix(' ms')->sortable(),
|
||||
TextColumn::make('created_at')->since()->sortable(),
|
||||
])
|
||||
->filters([
|
||||
TernaryFilter::make('successful'),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
])
|
||||
->defaultSort('created_at', 'desc');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases;
|
||||
|
||||
use App\Filament\Resources\BazaarPurchases\Pages\ListBazaarPurchases;
|
||||
use App\Filament\Resources\BazaarPurchases\Pages\ViewBazaarPurchase;
|
||||
use App\Filament\Resources\BazaarPurchases\Schemas\BazaarPurchaseForm;
|
||||
use App\Filament\Resources\BazaarPurchases\Schemas\BazaarPurchaseInfolist;
|
||||
use App\Filament\Resources\BazaarPurchases\Tables\BazaarPurchasesTable;
|
||||
use App\Models\BazaarPurchase;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BazaarPurchaseResource extends Resource
|
||||
{
|
||||
protected static ?string $model = BazaarPurchase::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Cafe Bazaar';
|
||||
|
||||
protected static ?string $navigationLabel = 'Purchases';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BazaarPurchaseForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return BazaarPurchaseInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BazaarPurchasesTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBazaarPurchases::route('/'),
|
||||
'view' => ViewBazaarPurchase::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarPurchases\BazaarPurchaseResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBazaarPurchase extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BazaarPurchaseResource::class;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarPurchases\BazaarPurchaseResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBazaarPurchase extends EditRecord
|
||||
{
|
||||
protected static string $resource = BazaarPurchaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarPurchases\BazaarPurchaseResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBazaarPurchases extends ListRecords
|
||||
{
|
||||
protected static string $resource = BazaarPurchaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarPurchases\BazaarPurchaseResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewBazaarPurchase extends ViewRecord
|
||||
{
|
||||
protected static string $resource = BazaarPurchaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarPurchaseForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarPurchaseInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('product_id'),
|
||||
TextEntry::make('purchase_token')->copyable()->columnSpanFull(),
|
||||
TextEntry::make('status')->badge(),
|
||||
IconEntry::make('is_consumed')->boolean(),
|
||||
TextEntry::make('purchased_at')->dateTime(),
|
||||
TextEntry::make('validated_at')->dateTime(),
|
||||
TextEntry::make('bazaar_response')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarPurchases\Tables;
|
||||
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BazaarPurchasesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('product_id')->searchable()->sortable(),
|
||||
TextColumn::make('status')->badge()->sortable(),
|
||||
IconColumn::make('is_consumed')->boolean(),
|
||||
TextColumn::make('purchased_at')->dateTime()->sortable(),
|
||||
TextColumn::make('validated_at')->since()->sortable(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')->options([
|
||||
'purchased' => 'Purchased',
|
||||
'refunded' => 'Refunded',
|
||||
'unknown' => 'Unknown',
|
||||
]),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
])
|
||||
->defaultSort('created_at', 'desc');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\Pages\ListBazaarReleases;
|
||||
use App\Filament\Resources\BazaarReleases\Pages\ViewBazaarRelease;
|
||||
use App\Filament\Resources\BazaarReleases\Schemas\BazaarReleaseForm;
|
||||
use App\Filament\Resources\BazaarReleases\Schemas\BazaarReleaseInfolist;
|
||||
use App\Filament\Resources\BazaarReleases\Tables\BazaarReleasesTable;
|
||||
use App\Models\BazaarRelease;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BazaarReleaseResource extends Resource
|
||||
{
|
||||
protected static ?string $model = BazaarRelease::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Cafe Bazaar';
|
||||
|
||||
protected static ?string $navigationLabel = 'Publishing';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BazaarReleaseForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return BazaarReleaseInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BazaarReleasesTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBazaarReleases::route('/'),
|
||||
'view' => ViewBazaarRelease::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBazaarRelease extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBazaarRelease extends EditRecord
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBazaarReleases extends ListRecords
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewBazaarRelease extends ViewRecord
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarReleaseForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarReleaseInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('bazaar_release_id')->label('Bazaar release ID'),
|
||||
TextEntry::make('status')->badge(),
|
||||
TextEntry::make('artifact_type')->badge(),
|
||||
TextEntry::make('staged_rollout_percentage')->suffix('%'),
|
||||
IconEntry::make('auto_publish')->boolean(),
|
||||
TextEntry::make('changelog_fa')->columnSpanFull(),
|
||||
TextEntry::make('changelog_en')->columnSpanFull(),
|
||||
TextEntry::make('developer_note')->columnSpanFull(),
|
||||
TextEntry::make('bazaar_response')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Tables;
|
||||
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BazaarReleasesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('bazaar_release_id')->label('Bazaar ID')->sortable(),
|
||||
TextColumn::make('status')->badge()->sortable(),
|
||||
TextColumn::make('artifact_type')->badge(),
|
||||
TextColumn::make('staged_rollout_percentage')->suffix('%')->sortable(),
|
||||
IconColumn::make('auto_publish')->boolean(),
|
||||
TextColumn::make('committed_at')->dateTime()->sortable(),
|
||||
TextColumn::make('published_at')->dateTime()->sortable(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')->options([
|
||||
'draft' => 'Draft',
|
||||
'awaiting_bin' => 'Awaiting BIN',
|
||||
'processing_bundle' => 'Processing bundle',
|
||||
'artifact_uploaded' => 'Artifact uploaded',
|
||||
'committed' => 'Committed',
|
||||
'published' => 'Published',
|
||||
'deleted' => 'Deleted',
|
||||
]),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
])
|
||||
->defaultSort('created_at', 'desc');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews;
|
||||
|
||||
use App\Filament\Resources\BazaarReviews\Pages\ListBazaarReviews;
|
||||
use App\Filament\Resources\BazaarReviews\Pages\ViewBazaarReview;
|
||||
use App\Filament\Resources\BazaarReviews\Schemas\BazaarReviewForm;
|
||||
use App\Filament\Resources\BazaarReviews\Schemas\BazaarReviewInfolist;
|
||||
use App\Filament\Resources\BazaarReviews\Tables\BazaarReviewsTable;
|
||||
use App\Models\BazaarReview;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BazaarReviewResource extends Resource
|
||||
{
|
||||
protected static ?string $model = BazaarReview::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Cafe Bazaar';
|
||||
|
||||
protected static ?string $navigationLabel = 'Reviews';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BazaarReviewForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return BazaarReviewInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BazaarReviewsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBazaarReviews::route('/'),
|
||||
'view' => ViewBazaarReview::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReviews\BazaarReviewResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBazaarReview extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BazaarReviewResource::class;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReviews\BazaarReviewResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBazaarReview extends EditRecord
|
||||
{
|
||||
protected static string $resource = BazaarReviewResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReviews\BazaarReviewResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBazaarReviews extends ListRecords
|
||||
{
|
||||
protected static string $resource = BazaarReviewResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReviews\BazaarReviewResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewBazaarReview extends ViewRecord
|
||||
{
|
||||
protected static string $resource = BazaarReviewResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarReviewForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarReviewInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('bazaar_review_id')->label('Bazaar review ID'),
|
||||
TextEntry::make('rate')->badge(),
|
||||
TextEntry::make('text')->columnSpanFull(),
|
||||
TextEntry::make('app_version_code'),
|
||||
IconEntry::make('is_edited')->boolean(),
|
||||
TextEntry::make('published_at')->dateTime(),
|
||||
TextEntry::make('developer_reply_text')->columnSpanFull(),
|
||||
TextEntry::make('developer_reply_email'),
|
||||
TextEntry::make('developer_replied_at')->dateTime(),
|
||||
TextEntry::make('bazaar_response')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReviews\Tables;
|
||||
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BazaarReviewsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('rate')->badge()->sortable(),
|
||||
TextColumn::make('text')->limit(70)->searchable()->wrap(),
|
||||
TextColumn::make('app_version_code')->label('App version')->sortable(),
|
||||
IconColumn::make('replied')->label('Replied')->state(fn ($record): bool => filled($record->developer_reply_text))->boolean(),
|
||||
TextColumn::make('published_at')->dateTime()->sortable(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('rate')->options([1 => '1 star', 2 => '2 stars', 3 => '3 stars', 4 => '4 stars', 5 => '5 stars']),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
])
|
||||
->defaultSort('published_at', 'desc');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions;
|
||||
|
||||
use App\Filament\Resources\BazaarSubscriptions\Pages\ListBazaarSubscriptions;
|
||||
use App\Filament\Resources\BazaarSubscriptions\Pages\ViewBazaarSubscription;
|
||||
use App\Filament\Resources\BazaarSubscriptions\Schemas\BazaarSubscriptionForm;
|
||||
use App\Filament\Resources\BazaarSubscriptions\Schemas\BazaarSubscriptionInfolist;
|
||||
use App\Filament\Resources\BazaarSubscriptions\Tables\BazaarSubscriptionsTable;
|
||||
use App\Models\BazaarSubscription;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BazaarSubscriptionResource extends Resource
|
||||
{
|
||||
protected static ?string $model = BazaarSubscription::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Cafe Bazaar';
|
||||
|
||||
protected static ?string $navigationLabel = 'Subscriptions';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BazaarSubscriptionForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return BazaarSubscriptionInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BazaarSubscriptionsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBazaarSubscriptions::route('/'),
|
||||
'view' => ViewBazaarSubscription::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarSubscriptions\BazaarSubscriptionResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBazaarSubscription extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BazaarSubscriptionResource::class;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarSubscriptions\BazaarSubscriptionResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBazaarSubscription extends EditRecord
|
||||
{
|
||||
protected static string $resource = BazaarSubscriptionResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarSubscriptions\BazaarSubscriptionResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBazaarSubscriptions extends ListRecords
|
||||
{
|
||||
protected static string $resource = BazaarSubscriptionResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarSubscriptions\BazaarSubscriptionResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewBazaarSubscription extends ViewRecord
|
||||
{
|
||||
protected static string $resource = BazaarSubscriptionResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarSubscriptionForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarSubscriptionInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('subscription_id'),
|
||||
TextEntry::make('purchase_token')->copyable()->columnSpanFull(),
|
||||
TextEntry::make('linked_subscription_token')->copyable()->columnSpanFull(),
|
||||
TextEntry::make('status')->badge(),
|
||||
IconEntry::make('auto_renewing')->boolean(),
|
||||
TextEntry::make('starts_at')->dateTime(),
|
||||
TextEntry::make('valid_until')->dateTime(),
|
||||
TextEntry::make('bazaar_response')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarSubscriptions\Tables;
|
||||
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BazaarSubscriptionsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('subscription_id')->searchable()->sortable(),
|
||||
TextColumn::make('status')->badge()->sortable(),
|
||||
IconColumn::make('auto_renewing')->boolean(),
|
||||
TextColumn::make('starts_at')->dateTime()->sortable(),
|
||||
TextColumn::make('valid_until')->dateTime()->sortable(),
|
||||
TextColumn::make('validated_at')->since()->sortable(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')->options([
|
||||
'active' => 'Active',
|
||||
'expired' => 'Expired',
|
||||
'cancelled' => 'Cancelled',
|
||||
'refunded' => 'Refunded',
|
||||
'unknown' => 'Unknown',
|
||||
]),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
])
|
||||
->defaultSort('created_at', 'desc');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user