Skip to content

Commit 48a26e4

Browse files
committed
wip
1 parent 0ce4020 commit 48a26e4

File tree

4 files changed

+26
-291
lines changed

4 files changed

+26
-291
lines changed

src/Concerns/HasUrl.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Native\Laravel\Concerns;
4+
5+
trait HasUrl
6+
{
7+
protected string $url = '';
8+
9+
public function url(string $url): self
10+
{
11+
$this->url = $url;
12+
13+
return $this;
14+
}
15+
16+
public function route(string $route): self
17+
{
18+
$this->url = route($route);
19+
20+
return $this;
21+
}
22+
}

src/MenuBar/MenuBar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
use Native\Laravel\Client\Client;
66
use Native\Laravel\Concerns\HasDimensions;
7+
use Native\Laravel\Concerns\HasUrl;
78
use Native\Laravel\Concerns\HasVibrancy;
89
use Native\Laravel\Menu\Menu;
910

1011
class MenuBar
1112
{
1213
use HasVibrancy;
1314
use HasDimensions;
14-
15-
protected string $url = '';
15+
use HasUrl;
1616

1717
protected string $icon = '';
1818

src/Window.php

Lines changed: 0 additions & 280 deletions
This file was deleted.

src/Windows/Window.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
use Illuminate\Support\Facades\URL;
66
use Native\Laravel\Client\Client;
77
use Native\Laravel\Concerns\HasDimensions;
8+
use Native\Laravel\Concerns\HasUrl;
89
use Native\Laravel\Concerns\HasVibrancy;
910

1011
class Window
1112
{
1213
use HasVibrancy;
1314
use HasDimensions;
14-
15-
protected string $url = '';
15+
use HasUrl;
1616

1717
protected $manageState = false;
1818

@@ -48,13 +48,6 @@ public function id(string $id = 'main'): self
4848
return $this;
4949
}
5050

51-
public function url(string $url): self
52-
{
53-
$this->url = $url;
54-
55-
return $this;
56-
}
57-
5851
public function title(string $title): self
5952
{
6053
$this->title = $title;

0 commit comments

Comments
 (0)