add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 72a7b270f9
commit 0879b0abf0
459 changed files with 6219 additions and 5416 deletions

View File

@@ -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;
}