/** * Resolve the route item and return it's ID. * Defaults to null if no match can be found. * * @param $parent * @return mixed */ protected static function getRouteID($route) { $route_id = null; // // If a string was provided, find the Route based on that name. // if (is_string($route)) { // $route = Route::where('name', $route)->first(); // } $route = Route::resolve($route); // If a Route object was provided or found in the previous block, // return the ID of that object. if ($route instanceof Route) { $route_id = $route->id; } return $route_id; }