Skip to content

Commit 95d89df

Browse files
authored
Merge pull request #317 from NativePHP/update-plugin-copy
Update first-party plugins copy to 'at no extra cost'
2 parents 21699ae + bd786d5 commit 95d89df

File tree

11 files changed

+176
-4
lines changed

11 files changed

+176
-4
lines changed

app/Filament/Resources/PluginResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ public static function table(Table $table): Table
242242
})
243243
->sortable(),
244244

245+
Tables\Columns\TextColumn::make('mobile_min_version')
246+
->label('Mobile SDK')
247+
->placeholder('-')
248+
->toggleable(isToggledHiddenByDefault: true),
249+
245250
Tables\Columns\ToggleColumn::make('featured')
246251
->sortable(),
247252

app/Services/PluginSyncService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ public function sync(Plugin $plugin): bool
8989
$updateData['android_version'] = $this->extractAndroidVersion($nativephpData);
9090
}
9191

92+
if ($composerData) {
93+
$updateData['mobile_min_version'] = $composerData['require']['nativephp/mobile'] ?? null;
94+
}
95+
9296
if ($readme) {
9397
$updateData['readme_html'] = CommonMark::convertToHtml($readme);
9498
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('plugins', function (Blueprint $table) {
15+
$table->string('mobile_min_version')->nullable()->after('android_version');
16+
});
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*/
22+
public function down(): void
23+
{
24+
Schema::table('plugins', function (Blueprint $table) {
25+
$table->dropColumn('mobile_min_version');
26+
});
27+
}
28+
};

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/views/components/layout.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ class="mx-auto w-full max-w-5xl px-5 lg:px-3 xl:max-w-7xl 2xl:max-w-360"
121121
</div>
122122

123123
<x-footer />
124+
125+
<x-impersonate::banner/>
126+
124127
@livewireScriptConfig
125128
@fluxScripts
126129
@vite('resources/js/app.js')

resources/views/customer/ultra/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
</div>
150150
@endif
151151
</div>
152-
<div>
152+
<div class="min-w-0">
153153
<a href="{{ route('plugins.show', $plugin->routeParams()) }}" class="font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300">
154154
{{ $plugin->name }}
155155
</a>

resources/views/livewire/customer/dashboard.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
Upgrade to NativePHP Ultra
3636
</h3>
3737
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
38-
Get all first-party plugins for free, premium support, team management, and more.
38+
Access all first-party plugins at no extra cost, premium support, team management, and more.
3939
</p>
4040
<div class="mt-4">
4141
<a href="{{ route('pricing') }}" class="inline-flex items-center rounded-md border border-transparent bg-black px-4 py-2 text-sm font-medium text-white transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:ring-offset-2 dark:bg-white dark:text-black dark:hover:bg-zinc-200">

resources/views/livewire/mobile-pricing.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class="grid size-7 shrink-0 place-items-center rounded-xl bg-[#D4FD7D] dark:bg-[
228228
>
229229
<x-icons.checkmark class="size-5 shrink-0" />
230230
</div>
231-
<div class="font-medium">All first-party plugins for free</div>
231+
<div class="font-medium">All first-party plugins at no extra cost</div>
232232
</div>
233233
<div class="flex items-center gap-2">
234234
<div

resources/views/plugin-show.blade.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ class="inline-flex items-center gap-1 text-sm font-medium text-indigo-600 hover:
246246
</dd>
247247
</div>
248248

249+
{{-- NativePHP Mobile --}}
250+
<div class="col-span-2 rounded-xl bg-gray-50 p-3 dark:bg-slate-700/30">
251+
<dt class="text-xs font-medium text-gray-500 dark:text-gray-400">NativePHP Mobile</dt>
252+
<dd class="mt-1 text-sm font-medium text-gray-900 dark:text-white">
253+
{{ $plugin->mobile_min_version ?? '' }}
254+
</dd>
255+
</div>
256+
249257
{{-- iOS Version --}}
250258
<div class="rounded-xl bg-gray-50 p-3 dark:bg-slate-700/30">
251259
<dt class="text-xs font-medium text-gray-500 dark:text-gray-400">iOS</dt>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace Tests\Feature;
4+
5+
use App\Features\ShowPlugins;
6+
use App\Models\Plugin;
7+
use Illuminate\Foundation\Testing\RefreshDatabase;
8+
use Laravel\Pennant\Feature;
9+
use Tests\TestCase;
10+
11+
class PluginShowMobileVersionTest extends TestCase
12+
{
13+
use RefreshDatabase;
14+
15+
protected function setUp(): void
16+
{
17+
parent::setUp();
18+
19+
Feature::define(ShowPlugins::class, true);
20+
}
21+
22+
public function test_plugin_show_displays_mobile_min_version(): void
23+
{
24+
$plugin = Plugin::factory()->approved()->create([
25+
'mobile_min_version' => '^3.0.0',
26+
]);
27+
28+
$this->get(route('plugins.show', $plugin->routeParams()))
29+
->assertStatus(200)
30+
->assertSee('NativePHP Mobile')
31+
->assertSee('^3.0.0');
32+
}
33+
34+
public function test_plugin_show_displays_dash_when_mobile_min_version_is_null(): void
35+
{
36+
$plugin = Plugin::factory()->approved()->create([
37+
'mobile_min_version' => null,
38+
]);
39+
40+
$this->get(route('plugins.show', $plugin->routeParams()))
41+
->assertStatus(200)
42+
->assertSee('NativePHP Mobile');
43+
}
44+
}

0 commit comments

Comments
 (0)