add shipping rules
This commit is contained in:
@@ -9,7 +9,6 @@ class Item extends LavaryMenuItem
|
||||
/**
|
||||
* Set the item icon using font-awesome.
|
||||
*
|
||||
* @param $icon
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
@@ -23,7 +22,6 @@ class Item extends LavaryMenuItem
|
||||
/**
|
||||
* Set the item order.
|
||||
*
|
||||
* @param $order
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
@@ -37,29 +35,29 @@ class Item extends LavaryMenuItem
|
||||
/**
|
||||
* Make the item active.
|
||||
*
|
||||
* @param string|array $routes
|
||||
*
|
||||
* @param string|array $routes
|
||||
* @return self
|
||||
*/
|
||||
public function activeIfRoute($routes = null)
|
||||
{
|
||||
if (!empty($routes)) {
|
||||
if (! empty($routes)) {
|
||||
if (is_string($routes)) {
|
||||
$routes = [$routes];
|
||||
}
|
||||
|
||||
foreach ($routes as $pattern) {
|
||||
$arr = [$pattern];
|
||||
if (!if_route_pattern($arr)){
|
||||
continue;}
|
||||
$this->activate();
|
||||
|
||||
if (strstr($this->title, 'circle-o')) {
|
||||
$this->title = str_replace('fa-circle-o', 'fa-dot-circle-o', $this->title);
|
||||
}
|
||||
// dump($this);
|
||||
return $this;
|
||||
if (! if_route_pattern($arr)) {
|
||||
continue;
|
||||
}
|
||||
$this->activate();
|
||||
|
||||
if (strstr($this->title, 'circle-o')) {
|
||||
$this->title = str_replace('fa-circle-o', 'fa-dot-circle-o', $this->title);
|
||||
}
|
||||
// dump($this);
|
||||
return $this;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user