8000 Dock goodies (#421) · NativePHP/laravel@79f8966 · GitHub
[go: up one dir, main page]

Skip to content

Commit 79f8966

Browse files
authored
Dock goodies (#421)
* Dock goodies * Fix styling * fix --------- Co-authored-by: simonhamp <simonhamp@users.noreply.github.com>
1 parent 41459c2 commit 79f8966

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/Dock.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,38 @@ public function menu(Menu $menu)
1717
'items' => $items,
1818
]);
1919
}
20+
21+
public function show()
22+
{
23+
$this->client->post('dock/show');
24+
}
25+
26+
public function hide()
27+
{
28+
$this->client->post('dock/hide');
29+
}
30+
31+
public function icon(string $path)
32+
{
33+
$this->client->post('dock/icon', ['path' => $path]);
34+
}
35+
36+
public function bounce(string $type = 'informational')
37+
{
38+
$this->client->post('dock/bounce', ['type' => $type]);
39+
}
40+
41+
public function cancelBounce()
42+
{
43+
$this->client->post('dock/cancel-bounce');
44+
}
45+
46+
public function badge(?string $label = null): void|string
47+
{
48+
if (is_null($label)) {
49+
return $this->client->get('dock/badge');
50+
}
51+
52+
$this->client->post('dock/badge', ['label' => $label]);
53+
}
2054
}

src/Facades/Dock.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
use Native\Laravel\Menu\Menu;
77

88
/**
9+
* @method static void bounce()
10+
* @method static void|string badge(string $type = null)
11+
* @method static void cancelBounce()
12+
* @method static void hide()
13+
* @method static void icon(string $Path)
914
* @method static void menu(Menu $menu)
15+
* @method static void show()
1016
*/
1117
class Dock extends Facade
1218
{

0 commit comments

Comments
 (0)
0