Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/Dock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,38 @@ public function menu(Menu $menu)
'items' => $items,
]);
}

public function show()
{
$this->client->post('dock/show');
}

public function hide()
{
$this->client->post('dock/hide');
}

public function icon(string $path)
{
$this->client->post('dock/icon', ['path' => $path]);
}

public function bounce(string $type = 'informational')
{
$this->client->post('dock/bounce', ['type' => $type]);
}

public function cancelBounce()
{
$this->client->post('dock/cancel-bounce');
}

public function badge(?string $label = null): void|string
{
if (is_null($label)) {
return $this->client->get('dock/badge');
}

$this->client->post('dock/badge', ['label' => $label]);
}
}
6 changes: 6 additions & 0 deletions src/Facades/Dock.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
use Native\Laravel\Menu\Menu;

/**
* @method static void bounce()
* @method static void|string badge(string $type = null)
* @method static void cancelBounce()
* @method static void hide()
* @method static void icon(string $Path)
* @method static void menu(Menu $menu)
* @method static void show()
*/
class Dock extends Facade
{
Expand Down
Loading