Skip to content

Commit 19c4c7c

Browse files
simonhampclaude
andauthored
Add premium plugin installation docs to Using Plugins page (#336)
* Add premium plugin installation docs to Using Plugins page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add copy feedback, auth-aware credentials, and iOS Simulator push notification aside - Copy buttons now show green check icon for 2s after copying (plugin show + dashboard) - Plugin show page swaps in real user credentials when logged in - Add iOS Simulator push notification limitation aside to all mobile doc versions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1f5aa62 commit 19c4c7c

File tree

7 files changed

+124
-5
lines changed

7 files changed

+124
-5
lines changed

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/customer/plugin-credentials.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
</div>
2626
<button
2727
type="button"
28-
x-data x-on:click="navigator.clipboard.writeText('composer config repositories.nativephp-plugins composer https://plugins.nativephp.com')"
28+
x-data="{ copied: false }"
29+
x-on:click="navigator.clipboard.writeText('composer config repositories.nativephp-plugins composer https://plugins.nativephp.com').then(() => { copied = true; setTimeout(() => copied = false, 2000) })"
2930
class="shrink-0 self-stretch bg-zinc-900 px-3 text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"
3031
title="Copy command"
3132
>
32-
<flux:icon name="clipboard" variant="outline" class="size-4" />
33+
<flux:icon x-show="!copied" name="clipboard" variant="outline" class="size-4" />
34+
<flux:icon x-show="copied" x-cloak name="check-circle" variant="outline" class="size-4 text-green-400" />
3335
</button>
3436
</div>
3537
<flux:text class="text-xs">2. Configure your credentials:</flux:text>
@@ -39,11 +41,13 @@ class="shrink-0 self-stretch bg-zinc-900 px-3 text-zinc-400 hover:bg-zinc-800 ho
3941
</div>
4042
<button
4143
type="button"
42-
x-data x-on:click="navigator.clipboard.writeText('composer config http-basic.plugins.nativephp.com {{ auth()->user()->email }} {{ $pluginLicenseKey }}')"
44+
x-data="{ copied: false }"
45+
x-on:click="navigator.clipboard.writeText('composer config http-basic.plugins.nativephp.com {{ auth()->user()->email }} {{ $pluginLicenseKey }}').then(() => { copied = true; setTimeout(() => copied = false, 2000) })"
4346
class="shrink-0 self-stretch bg-zinc-900 px-3 text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"
4447
title="Copy command"
4548
>
46-
<flux:icon name="clipboard" variant="outline" class="size-4" />
49+
<flux:icon x-show="!copied" name="clipboard" variant="outline" class="size-4" />
50+
<flux:icon x-show="copied" x-cloak name="check-circle" variant="outline" class="size-4 text-green-400" />
4751
</button>
4852
</div>
4953
</div>

resources/views/docs/mobile/1/concepts/push-notifications.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ user's device.
8888

8989
<aside>
9090

91+
Push notifications do not work in the iOS Simulator. This is an Apple limitation. You must use a physical iOS device
92+
to test push notifications.
93+
94+
</aside>
95+
96+
<aside>
97+
9198
The server-side implementation is out of scope for this documentation.
9299

93100
</aside>

resources/views/docs/mobile/2/concepts/push-notifications.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ user's device.
8888

8989
<aside>
9090

91+
Push notifications do not work in the iOS Simulator. This is an Apple limitation. You must use a physical iOS device
92+
to test push notifications.
93+
94+
</aside>
95+
96+
<aside>
97+
9198
The server-side implementation is out of scope for this documentation.
9299

93100
</aside>

resources/views/docs/mobile/3/concepts/push-notifications.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ user's device.
8888

8989
<aside>
9090

91+
Push notifications do not work in the iOS Simulator. This is an Apple limitation. You must use a physical iOS device
92+
to test push notifications.
93+
94+
</aside>
95+
96+
<aside>
97+
9198
The server-side implementation is out of scope for this documentation.
9299

93100
</aside>

resources/views/docs/mobile/3/plugins/using-plugins.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,33 @@ composer require vendor/nativephp-plugin-name
1414
The plugin's PHP service provider will be auto-discovered by Laravel, but the native code won't be included in builds
1515
until you explicitly register it.
1616

17+
### Installing Premium Plugins
18+
19+
Premium plugins from the [NativePHP Plugin Marketplace](/plugins) are served via a private Composer repository.
20+
You'll need to configure Composer before you can install them.
21+
22+
**1. Add the NativePHP plugins repository:**
23+
24+
```shell
25+
composer config repositories.nativephp-plugins composer https://plugins.nativephp.com
26+
```
27+
28+
**2. Configure your credentials:**
29+
30+
```shell
31+
composer config http-basic.plugins.nativephp.com your-email@example.com your-license-key
32+
```
33+
34+
You can find your credentials on your [Purchased Plugins](/dashboard/purchased-plugins) dashboard.
35+
36+
**3. Install the plugin:**
37+
38+
Once configured, install premium plugins just like any other:
39+
40+
```shell
41+
composer require vendor/nativephp-premium-plugin
42+
```
43+
1744
## Register the Plugin
1845

1946
For security, plugins must be explicitly registered before their native code is compiled into your app. This prevents

resources/views/plugin-show.blade.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,73 @@ class="font-mono text-2xl font-bold sm:text-3xl"
105105
</div>
106106
@endif
107107

108+
@if ($plugin->isPaid())
109+
<aside class="mb-6 rounded-2xl border border-indigo-200 bg-indigo-50 p-5 dark:border-indigo-800 dark:bg-indigo-950/30">
110+
<h3 class="text-sm font-semibold text-indigo-900 dark:text-indigo-200">Installing this plugin</h3>
111+
<p class="mt-1 text-sm text-indigo-800 dark:text-indigo-300">
112+
Premium plugins require Composer to be configured with the NativePHP plugin repository and your credentials.
113+
</p>
114+
<div class="mt-3 space-y-2">
115+
<div class="flex items-center gap-2 rounded-lg bg-zinc-900 dark:bg-zinc-800">
116+
<div class="min-w-0 flex-1 overflow-x-auto p-3">
117+
<code class="block whitespace-pre font-mono text-xs text-zinc-100">composer config repositories.nativephp-plugins composer https://plugins.nativephp.com</code>
118+
</div>
119+
<button
120+
type="button"
121+
x-data="{ copied: false }"
122+
x-on:click="navigator.clipboard.writeText('composer config repositories.nativephp-plugins composer https://plugins.nativephp.com').then(() => { copied = true; setTimeout(() => copied = false, 2000) })"
123+
class="shrink-0 self-stretch px-3 text-zinc-400 hover:text-zinc-200"
124+
title="Copy command"
125+
>
126+
<x-heroicon-o-clipboard x-show="!copied" class="size-4" />
127+
<x-heroicon-o-check-circle x-show="copied" x-cloak class="size-4 text-green-400" />
128+
</button>
129+
</div>
130+
@auth
131+
<div class="flex items-center gap-2 rounded-lg bg-zinc-900 dark:bg-zinc-800">
132+
<div class="min-w-0 flex-1 overflow-x-auto p-3">
133+
<code class="block whitespace-pre font-mono text-xs text-zinc-100">composer config http-basic.plugins.nativephp.com {{ auth()->user()->email }} {{ auth()->user()->getPluginLicenseKey() }}</code>
134+
</div>
135+
<button
136+
type="button"
137+
x-data="{ copied: false }"
138+
x-on:click="navigator.clipboard.writeText('composer config http-basic.plugins.nativephp.com {{ auth()->user()->email }} {{ auth()->user()->getPluginLicenseKey() }}').then(() => { copied = true; setTimeout(() => copied = false, 2000) })"
139+
class="shrink-0 self-stretch px-3 text-zinc-400 hover:text-zinc-200"
140+
title="Copy command"
141+
>
142+
<x-heroicon-o-clipboard x-show="!copied" class="size-4" />
143+
<x-heroicon-o-check-circle x-show="copied" x-cloak class="size-4 text-green-400" />
144+
</button>
145+
</div>
146+
@else
147+
<div class="flex items-center gap-2 rounded-lg bg-zinc-900 dark:bg-zinc-800">
148+
<div class="min-w-0 flex-1 overflow-x-auto p-3">
149+
<code class="block whitespace-pre font-mono text-xs text-zinc-100">composer config http-basic.plugins.nativephp.com <span class="text-zinc-400">your-email@example.com</span> <span class="text-zinc-400">your-license-key</span></code>
150+
</div>
151+
<button
152+
type="button"
153+
x-data="{ copied: false }"
154+
x-on:click="navigator.clipboard.writeText('composer config http-basic.plugins.nativephp.com your-email@example.com your-license-key').then(() => { copied = true; setTimeout(() => copied = false, 2000) })"
155+
class="shrink-0 self-stretch px-3 text-zinc-400 hover:text-zinc-200"
156+
title="Copy command"
157+
>
158+
<x-heroicon-o-clipboard x-show="!copied" class="size-4" />
159+
<x-heroicon-o-check-circle x-show="copied" x-cloak class="size-4 text-green-400" />
160+
</button>
161+
</div>
162+
@endauth
163+
</div>
164+
<p class="mt-3 text-xs text-indigo-700 dark:text-indigo-400">
165+
@auth
166+
Manage your credentials on your <a href="{{ route('customer.purchased-plugins.index') }}" class="font-medium underline hover:no-underline">Purchased Plugins</a> dashboard.
167+
@else
168+
<a href="{{ route('login') }}" class="font-medium underline hover:no-underline">Log in</a> to see your credentials, or find them on your <a href="{{ route('customer.purchased-plugins.index') }}" class="font-medium underline hover:no-underline">Purchased Plugins</a> dashboard.
169+
@endauth
170+
<a href="{{ url('docs/mobile/3/plugins/using-plugins') }}" class="font-medium underline hover:no-underline">Learn more &rarr;</a>
171+
</p>
172+
</aside>
173+
@endif
174+
108175
<article
109176
x-init="
110177
() => {

0 commit comments

Comments
 (0)