path(); } if (empty($item['children'])) { if (empty($item['uri'])) { return false; } // return trim($this->getPath($item['uri']), '/') == $path; // dd($path, trim($this->getPath($item['uri']), '/admin'), strpos($path, trim($this->getPath($item['uri']), '/admin'))); $_uri = trim($this->getPath($item['uri']), '/admin'); if (empty($_uri) && $path!=='admin') { return false; } return strpos($path, $_uri) !== false; } foreach ($item['children'] as $v) { // $_uri = trim($this->getPath($item['uri']), '/admin'); // if (empty($_uri) && $path!=='admin') { // return false; // } // if (strpos($path, $_uri) !== false) { // return true; // } dd($v, empty($v['children'])); if (! empty($v['children'])) { dd($v, $path); if ($this->isActive($v, $path)) { return true; } } } return false; } }