Skip to content

Commit 5da531b

Browse files
authored
Merge branch 'main' into feat/bundle-builds
2 parents 3e27e0b + 372614d commit 5da531b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/App.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ class App
99
{
1010
public function __construct(protected Client $client) {}
1111

12+
public function quit(): void
13+
{
14+
$this->client->post('app/quit');
15+
}
16+
1217
public function focus(): void
1318
{
1419
$this->client->post('app/focus');
@@ -62,5 +67,19 @@ public function clearRecentDocuments(): void
6267
public function isRunningBundled(): bool
6368
{
6469
return Phar::running() !== '';
70+
71+
}
72+
73+
public function openAtLogin(?bool $open = null): bool
74+
{
75+
if ($open === null) {
76+
return (bool) $this->client->get('app/open-at-login')->json('open');
77+
}
78+
79+
$this->client->post('app/open-at-login', [
80+
'open' => $open,
81+
]);
82+
83+
return $open;
6584
}
6685
}

src/Facades/App.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Support\Facades\Facade;
66

77
/**
8+
* @method static void quit()
89
* @method static void focus()
910
* @method static void hide()
1011
* @method static bool isHidden()
@@ -14,6 +15,7 @@
1415
* @method static array recentDocuments()
1516
* @method static void clearRecentDocuments()
1617
* @method static bool isRunningBundled()
18+
* @method static bool openAtLogin(?bool $open = null)
1719
*/
1820
class App extends Facade
1921
{

0 commit comments

Comments
 (0)