Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions app/Features/AllowPaidPlugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@

namespace App\Features;

use Laravel\Pennant\Feature;
use Stephenjude\FilamentFeatureFlag\Traits\WithFeatureResolver;

class AllowPaidPlugins
{
/**
* Resolve the feature's initial value.
*/
public function resolve(mixed $scope): bool
{
if ($scope) {
return Feature::for(null)->active(static::class);
}
use WithFeatureResolver;

return false;
}
}
protected bool $defaultValue = false;
}
14 changes: 3 additions & 11 deletions app/Features/ShowAuthButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@

namespace App\Features;

use Laravel\Pennant\Feature;
use Stephenjude\FilamentFeatureFlag\Traits\WithFeatureResolver;

class ShowAuthButtons
{
/**
* Resolve the feature's initial value.
*/
public function resolve(mixed $scope): bool
{
if ($scope) {
return Feature::for(null)->active(static::class);
}
use WithFeatureResolver;

return false;
}
protected bool $defaultValue = false;
}
16 changes: 4 additions & 12 deletions app/Features/ShowPlugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@

namespace App\Features;

use Laravel\Pennant\Feature;
use Stephenjude\FilamentFeatureFlag\Traits\WithFeatureResolver;

class ShowPlugins
{
/**
* Resolve the feature's initial value.
*/
public function resolve(mixed $scope): bool
{
if ($scope) {
return Feature::for(null)->active(static::class);
}
use WithFeatureResolver;

return false;
}
}
protected bool $defaultValue = false;
}
27 changes: 13 additions & 14 deletions app/Filament/Resources/PluginResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,29 @@ public static function form(Form $form): Form
->visible(fn (?Plugin $record) => $record !== null),

Forms\Components\TextInput::make('name')
->label('Composer Package Name')
->disabled(),
->label('Composer Package Name'),

Forms\Components\Select::make('type')
->options(PluginType::class)
->disabled(),
->options(PluginType::class),

Forms\Components\TextInput::make('repository_url')
->label('Repository URL')
->disabled()

->url()
->suffixIcon('heroicon-o-arrow-top-right-on-square')
->suffixIconColor('gray'),

Forms\Components\Select::make('status')
->options(PluginStatus::class)
->disabled(),
->options(PluginStatus::class),

Forms\Components\Textarea::make('description')
->label('Description')
->disabled()

->columnSpanFull(),

Forms\Components\Textarea::make('rejection_reason')
->label('Rejection Reason')
->disabled()

->visible(fn (?Plugin $record) => $record?->isRejected()),
])
->columns(2),
Expand All @@ -75,19 +72,19 @@ public static function form(Form $form): Form
->schema([
Forms\Components\Select::make('user_id')
->relationship('user', 'email')
->disabled(),
->searchable()
->preload(),

Forms\Components\DateTimePicker::make('created_at')
->label('Submitted At')
->disabled(),
->label('Submitted At'),

Forms\Components\Select::make('approved_by')
->relationship('approvedBy', 'email')
->disabled()

->visible(fn (?Plugin $record) => $record?->approved_by !== null),

Forms\Components\DateTimePicker::make('approved_at')
->disabled()

->visible(fn (?Plugin $record) => $record?->approved_at !== null),
])
->columns(2),
Expand Down Expand Up @@ -156,6 +153,7 @@ public static function table(Table $table): Table
->label('Active'),
])
->actions([
Tables\Actions\EditAction::make(),
// Approve Action
Tables\Actions\Action::make('approve')
->icon('heroicon-o-check')
Expand Down Expand Up @@ -263,6 +261,7 @@ public static function getPages(): array
{
return [
'index' => Pages\ListPlugins::route('/'),
'edit' => Pages\EditPlugin::route('/{record}/edit'),
'view' => Pages\ViewPlugin::route('/{record}'),
];
}
Expand Down
12 changes: 12 additions & 0 deletions app/Filament/Resources/PluginResource/Pages/EditPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Filament\Resources\PluginResource\Pages;

use App\Filament\Resources\PluginResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditPlugin extends EditRecord
{
protected static string $resource = PluginResource::class;
}
1 change: 1 addition & 0 deletions app/Jobs/HandleInvoicePaidJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function handle(): void
Invoice::BILLING_REASON_SUBSCRIPTION_CREATE => $this->handleSubscriptionCreated(),
Invoice::BILLING_REASON_SUBSCRIPTION_UPDATE => null, // TODO: Handle subscription update
Invoice::BILLING_REASON_SUBSCRIPTION_CYCLE => $this->handleSubscriptionRenewal(),
Invoice::BILLING_REASON_MANUAL => null,
default => null,
};
}
Expand Down
4 changes: 4 additions & 0 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Stephenjude\FilamentFeatureFlag\FeatureFlagPlugin;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
Expand Down Expand Up @@ -42,6 +43,9 @@ public function panel(Panel $panel): Panel
->widgets([
//
])
->plugins([
FeatureFlagPlugin::make(),
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"php": "^8.1",
"artesaos/seotools": "^1.2",
"blade-ui-kit/blade-heroicons": "^2.3",
"codeat3/blade-vaadin-icons": "^1.6",
"doctrine/dbal": "^3.9",
"embed/embed": "^4.4",
"filament/filament": "^3.2",
Expand All @@ -29,6 +30,7 @@
"simonhamp/the-og": "^0.7.0",
"spatie/laravel-menu": "^4.1",
"spatie/yaml-front-matter": "^2.0",
"stephenjude/filament-feature-flags": "^3.0",
"symfony/http-client": "^7.2",
"symfony/mailgun-mailer": "^7.1",
"torchlight/torchlight-commonmark": "^0.5.5"
Expand Down
141 changes: 140 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading