title = $title; $this->menu = $menu; $this->device_id = $deviceId; $this->current_tab = $currentTab; $this->selected = $selected; } /** * Determine if the given option is the current selected option. * * @param string $url * @return bool */ public function isSelected($url) { // check for get parameters $parsed_url = parse_url($url); if (isset($parsed_url['query']) && $parsed_url['path'] === $this->selected) { parse_str($parsed_url['query'], $vars); $request = request(); foreach ($vars as $key => $value) { if ($request->input($key) !== $value) { return false; } } return true; } return $url === $this->selected; } /** * Get the view / contents that represent the component. * * @return \Illuminate\View\View|string */ public function render() { return view('components.submenu'); } }