Skip to content

Commit 5aefae7

Browse files
Merge branch 'main' into add-mobile-search-input
2 parents 183ff17 + a3fb4a5 commit 5aefae7

File tree

90 files changed

+6310
-824
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6310
-824
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Also, be sure to read our [contributing guidelines](CONTRIBUTING.md) for help ge
1010

1111
## Issues
1212

13-
Please raise any issues on the [NativePHP/laravel](https://github.com/NativePHP/laravel/issues) repo.
13+
Please raise any issues on the [NativePHP/desktop](https://github.com/nativephp/desktop/issues) repo.

app/Livewire/VersionSwitcher.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace App\Livewire;
4+
5+
use Illuminate\View\ViewException;
6+
use Livewire\Component;
7+
8+
class VersionSwitcher extends Component
9+
{
10+
public string $platform;
11+
12+
public array $versions;
13+
14+
public int $version;
15+
16+
public string $page;
17+
18+
public function mount(array $versions)
19+
{
20+
// Since the props are always bound to the uri we fetch them
21+
// from the route instead of prop drilling or adding
22+
// single-use view data to the controller
23+
24+
throw_unless(
25+
request()->route()->named('docs.show'),
26+
ViewException::class,
27+
"The version switcher can only be used on the 'docs.show' route."
28+
);
29+
30+
$this->platform = request()->route()->parameter('platform');
31+
$this->version = request()->route()->parameter('version');
32+
$this->page = request()->route()->parameter('page');
33+
$this->versions = $versions;
34+
}
35+
36+
public function updatedVersion()
37+
{
38+
if (! $this->pageExists($this->platform, $this->version, $this->page)) {
39+
$this->page = 'introduction';
40+
}
41+
42+
return redirect()->route('docs.show', [
43+
'platform' => $this->platform,
44+
'version' => $this->version,
45+
'page' => $this->page,
46+
]);
47+
}
48+
49+
protected function pageExists(string $platform, int $version, string $page): bool
50+
{
51+
return file_exists(resource_path("views/docs/{$platform}/{$version}/{$page}.md"));
52+
}
53+
}

app/Notifications/LicenseKeyGenerated.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ public function toMail(object $notifiable): MailMessage
4040
->line('Thank you for purchasing a NativePHP for Mobile license.')
4141
->line('Your license key is:')
4242
->line("**{$this->licenseKey}**")
43-
->line('When prompted by Composer, use your email address as the username and this license key as the password.')
43+
->line('When prompted by Composer, use your **email address as the username** and this **license key as the password**.')
4444
->action('View Installation Guide', url('/docs/mobile/1/getting-started/installation'))
4545
->line('If you need to manage your subscription for this license, you can do so on [Stripe](https://billing.stripe.com/p/login/4gwaGV5VK0uU44E288).')
4646
->line("If you have any questions, please don't hesitate to reach out to our support team.")
47-
->lineIf($this->subscription === Subscription::Max, 'As a Max subscriber, you also have access to the NativePHP/mobile repository. To access it, please log in to [Anystack.sh](https://auth.anystack.sh/?accountType=customer) using the same email address you used for your purchase.')
47+
->lineIf($this->subscription !== Subscription::Mini, 'As a Pro or Max subscriber, you can manage license keys associated with your license in our [License Manager](https://nativephp.com/customer/licenses).')
48+
->lineIf($this->subscription === Subscription::Max, 'As a Max subscriber, you also have access to the NativePHP/mobile repository. To access it, please log in to [Anystack](https://auth.anystack.sh/?accountType=customer) using the same email address you used for your purchase.')
4849
->salutation("Happy coding!\n\nThe NativePHP Team")
4950
->success();
5051
}

app/Providers/AppServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ private function registerSharedViewVariables(): void
4848
? GitHub::electron()->latestVersion()
4949
: 'dev'
5050
);
51-
View::share('discordLink', 'https://discord.gg/X62tWNStZK');
51+
View::share('discordLink', 'https://discord.gg/nativephp');
5252
View::share('bskyLink', 'https://bsky.app/profile/nativephp.bsky.social');
5353
View::share('openCollectiveLink', 'https://opencollective.com/nativephp');
54-
View::share('githubLink', 'https://github.com/NativePHP');
54+
View::share('githubLink', 'https://github.com/nativephp');
5555
}
5656

5757
private function sendFailingJobsToSentry(): void

app/Support/GitHub.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,26 @@ class GitHub
1313

1414
public const PACKAGE_LARAVEL = 'nativephp/laravel';
1515

16+
public const PACKAGE_DESKTOP = 'nativephp/desktop';
17+
1618
public const PACKAGE_PHP_BIN = 'nativephp/php-bin';
1719

1820
public function __construct(
1921
private string $package
2022
) {}
2123

24+
public static function desktop(): static
25+
{
26+
return new static(static::PACKAGE_DESKTOP);
27+
}
28+
29+
// V1
2230
public static function electron(): static
2331
{
2432
return new static(static::PACKAGE_ELECTRON);
2533
}
2634

35+
// V1
2736
public static function laravel(): static
2837
{
2938
return new static(static::PACKAGE_LARAVEL);

0 commit comments

Comments
 (0)