Skip to content

Commit c3eedba

Browse files
committed
Merge remote-tracking branch 'origin/main' into ultra
# Conflicts: # app/Livewire/Customer/Plugins/Create.php # app/Models/User.php # resources/views/livewire/customer/licenses.blade.php # resources/views/livewire/customer/licenses/show.blade.php # resources/views/livewire/customer/plugins/create.blade.php
2 parents d81ddc7 + e77aa06 commit c3eedba

28 files changed

+813
-329
lines changed

app/Filament/Resources/ArticleResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
use Filament\Forms\Components\MarkdownEditor;
1313
use Filament\Forms\Components\Textarea;
1414
use Filament\Forms\Components\TextInput;
15-
use Filament\Forms\Set;
1615
use Filament\Resources\Resource;
16+
use Filament\Schemas\Components\Utilities\Set;
1717
use Filament\Schemas\Schema;
1818
use Filament\Tables\Columns\TextColumn;
1919
use Filament\Tables\Table;

app/Filament/Resources/PluginBundleResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static function form(Schema $schema): Schema
4242
->required()
4343
->maxLength(255)
4444
->live(onBlur: true)
45-
->afterStateUpdated(function (string $state, Forms\Set $set): void {
45+
->afterStateUpdated(function (string $state, Schemas\Components\Utilities\Set $set): void {
4646
$set('slug', Str::slug($state));
4747
}),
4848

app/Filament/Resources/PluginResource.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ public static function form(Schema $schema): Schema
154154
])
155155
->visible(fn (?Plugin $record) => $record?->review_checks !== null),
156156

157+
Schemas\Components\Section::make('Developer Submission Details')
158+
->schema([
159+
Forms\Components\Placeholder::make('support_channel_display')
160+
->label('Support Channel')
161+
->content(fn (?Plugin $record) => $record?->support_channel ?? 'Not provided'),
162+
163+
Forms\Components\Placeholder::make('notes_display')
164+
->label('Notes')
165+
->content(fn (?Plugin $record) => $record?->notes ?? 'Not provided'),
166+
])
167+
->visible(fn (?Plugin $record) => $record !== null),
168+
157169
Schemas\Components\Section::make('Submission Info')
158170
->schema([
159171
Forms\Components\Select::make('user_id')

app/Filament/Resources/ProductResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static function form(Schema $schema): Schema
4040
->required()
4141
->maxLength(255)
4242
->live(onBlur: true)
43-
->afterStateUpdated(function (string $state, Forms\Set $set): void {
43+
->afterStateUpdated(function (string $state, Schemas\Components\Utilities\Set $set): void {
4444
$set('slug', Str::slug($state));
4545
}),
4646

app/Filament/Resources/ShowcaseResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static function form(Schema $schema): Schema
7272
->live(),
7373

7474
Schemas\Components\Fieldset::make('Mobile Links')
75-
->visible(fn (Forms\Get $get) => $get('has_mobile'))
75+
->visible(fn (Schemas\Components\Utilities\Get $get) => $get('has_mobile'))
7676
->schema([
7777
Forms\Components\TextInput::make('app_store_url')
7878
->label('App Store URL')
@@ -86,7 +86,7 @@ public static function form(Schema $schema): Schema
8686
]),
8787

8888
Schemas\Components\Fieldset::make('Desktop Downloads')
89-
->visible(fn (Forms\Get $get) => $get('has_desktop'))
89+
->visible(fn (Schemas\Components\Utilities\Get $get) => $get('has_desktop'))
9090
->schema([
9191
Forms\Components\TextInput::make('windows_download_url')
9292
->label('Windows Download URL')

app/Filament/Resources/WallOfLoveSubmissionResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ public static function form(Schema $schema): Schema
8383
Forms\Components\Toggle::make('promoted')
8484
->label('Promoted to Homepage')
8585
->helperText('Promoted submissions appear in the feedback section on the homepage.')
86-
->visible(fn (Forms\Get $get) => $get('is_approved'))
86+
->visible(fn (Schemas\Components\Utilities\Get $get) => $get('is_approved'))
8787
->live(),
8888

8989
Forms\Components\Textarea::make('promoted_testimonial')
9090
->label('Promoted Testimonial (optional override)')
9191
->helperText('Leave empty to use the original testimonial, or enter a clipped version for the homepage.')
9292
->rows(4)
93-
->visible(fn (Forms\Get $get) => $get('is_approved') && $get('promoted')),
93+
->visible(fn (Schemas\Components\Utilities\Get $get) => $get('is_approved') && $get('promoted')),
9494
])
9595
->columns(1),
9696
]);

app/Http/Controllers/DeveloperOnboardingController.php

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,11 @@
88
use Illuminate\Http\RedirectResponse;
99
use Illuminate\Http\Request;
1010
use Illuminate\Validation\Rule;
11-
use Illuminate\View\View;
1211

1312
class DeveloperOnboardingController extends Controller
1413
{
1514
public function __construct(protected StripeConnectService $stripeConnectService) {}
1615

17-
public function show(Request $request): View|RedirectResponse
18-
{
19-
$user = $request->user();
20-
$developerAccount = $user->developerAccount;
21-
22-
if ($developerAccount && $developerAccount->hasCompletedOnboarding() && $developerAccount->hasAcceptedCurrentTerms()) {
23-
return to_route('customer.developer.dashboard')
24-
->with('message', 'Your developer account is already set up.');
25-
}
26-
27-
return view('customer.developer.onboarding', [
28-
'developerAccount' => $developerAccount,
29-
'hasExistingAccount' => $developerAccount !== null,
30-
]);
31-
}
32-
3316
public function start(Request $request): RedirectResponse
3417
{
3518
$request->validate([
@@ -131,35 +114,4 @@ public function refresh(Request $request): RedirectResponse
131114
->with('error', 'Unable to refresh onboarding. Please try again.');
132115
}
133116
}
134-
135-
public function dashboard(Request $request): View|RedirectResponse
136-
{
137-
$user = $request->user();
138-
$developerAccount = $user->developerAccount;
139-
140-
if (! $developerAccount || ! $developerAccount->hasCompletedOnboarding()) {
141-
return to_route('customer.developer.onboarding');
142-
}
143-
144-
$this->stripeConnectService->refreshAccountStatus($developerAccount);
145-
146-
$plugins = $user->plugins()->withCount('licenses')->get();
147-
$payouts = $developerAccount->payouts()->with('pluginLicense.plugin')->latest()->limit(10)->get();
148-
149-
$totalEarnings = $developerAccount->payouts()
150-
->where('status', 'transferred')
151-
->sum('developer_amount');
152-
153-
$pendingEarnings = $developerAccount->payouts()
154-
->where('status', 'pending')
155-
->sum('developer_amount');
156-
157-
return view('customer.developer.dashboard', [
158-
'developerAccount' => $developerAccount,
159-
'plugins' => $plugins,
160-
'payouts' => $payouts,
161-
'totalEarnings' => $totalEarnings,
162-
'pendingEarnings' => $pendingEarnings,
163-
]);
164-
}
165117
}

app/Jobs/HandleInvoicePaidJob.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,11 @@ private function createPluginLicense(User $user, Plugin $plugin, int $amount): P
562562

563563
// Create payout record for developer if applicable
564564
if ($plugin->developerAccount && $plugin->developerAccount->canReceivePayouts() && $amount > 0) {
565-
$split = PluginPayout::calculateSplit($amount);
565+
$platformFeePercent = ($user->hasMaxTierAccess() && ! $plugin->isOfficial())
566+
? 0
567+
: PluginPayout::PLATFORM_FEE_PERCENT;
568+
569+
$split = PluginPayout::calculateSplit($amount, $platformFeePercent);
566570

567571
PluginPayout::create([
568572
'plugin_license_id' => $license->id,
@@ -600,7 +604,11 @@ private function createBundlePluginLicense(User $user, Plugin $plugin, PluginBun
600604

601605
// Create proportional payout for developer
602606
if ($plugin->developerAccount && $plugin->developerAccount->canReceivePayouts() && $allocatedAmount > 0) {
603-
$split = PluginPayout::calculateSplit($allocatedAmount);
607+
$platformFeePercent = ($user->hasMaxTierAccess() && ! $plugin->isOfficial())
608+
? 0
609+
: PluginPayout::PLATFORM_FEE_PERCENT;
610+
611+
$split = PluginPayout::calculateSplit($allocatedAmount, $platformFeePercent);
604612

605613
PluginPayout::create([
606614
'plugin_license_id' => $license->id,

app/Livewire/Customer/Plugins/Create.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class Create extends Component
2626

2727
public string $repository = '';
2828

29+
public string $notes = '';
30+
31+
public string $supportChannel = '';
32+
2933
/** @var array<int, array{id: int, full_name: string, name: string, owner: string, private: bool}> */
3034
public array $repositories = [];
3135

@@ -133,6 +137,8 @@ function ($attribute, $value, $fail): void {
133137
},
134138
],
135139
'pluginType' => ['required', 'string', 'in:free,paid'],
140+
'notes' => ['nullable', 'string', 'max:5000'],
141+
'supportChannel' => ['nullable', 'string', 'max:255'],
136142
], [
137143
'repository.required' => 'Please select a repository for your plugin.',
138144
'repository.regex' => 'Please enter a valid repository in the format vendor/repo-name.',
@@ -181,6 +187,8 @@ function ($attribute, $value, $fail): void {
181187
'type' => $this->pluginType,
182188
'status' => PluginStatus::Pending,
183189
'developer_account_id' => $developerAccountId,
190+
'notes' => $this->notes ?: null,
191+
'support_channel' => $this->supportChannel ?: null,
184192
]);
185193

186194
$webhookSecret = $plugin->generateWebhookSecret();

app/Models/Plugin.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,15 @@ public function activePrice(): HasOne
166166
/**
167167
* Get the best (lowest) active price for a user based on their eligible tiers.
168168
* Returns null if no price exists for the user's eligible tiers.
169+
* Third-party plugins never offer subscriber discounts — always regular price.
169170
*/
170171
public function getBestPriceForUser(?User $user): ?PluginPrice
171172
{
172-
$eligibleTiers = $user ? $user->getEligiblePriceTiers() : [PriceTier::Regular];
173+
if (! $this->isOfficial()) {
174+
$eligibleTiers = [PriceTier::Regular];
175+
} else {
176+
$eligibleTiers = $user ? $user->getEligiblePriceTiers() : [PriceTier::Regular];
177+
}
173178

174179
// Get the lowest active price for the user's eligible tiers
175180
$bestPrice = $this->prices()

0 commit comments

Comments
 (0)