Skip to content

Commit

Permalink
Update type hints and method signature in Item and Menu classes
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Jun 27, 2024
1 parent ad0a79e commit 64ef979
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Item
public $submenu = [];

/**
* @var string array
* @var string|array
*/
public $gateName = null;

Expand Down Expand Up @@ -133,7 +133,7 @@ public function badge(string $badgeClass, string|Closure $badgeName)
return $this;
}

public function gate(string $gateName)
public function gate(...$gateName)
{
$this->gateName = $gateName;

Expand Down Expand Up @@ -237,7 +237,7 @@ public function hasActiveSubmenu($menu = null)
*/
public function isActive()
{
if (request()->routeIs($this->routeName) or request()->url() == $this->url) {
if (request()->routeIs($this->routeName) or request()->fullUrl() == $this->url) {
return true;
} else { // check child routes
return $this->hasActiveSubmenu(
Expand Down
2 changes: 1 addition & 1 deletion src/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function addItem(
* @param array $options
* @return \Salahhusa9\Menu\Menu
*/
public function addSubmenu($name, $callback, $options = [])
public function addSubmenu($name, $callback)
{
$item = new Item();
$item->new(
Expand Down

0 comments on commit 64ef979

Please sign in to comment.