Illuminate\Routing\Router::currentRouteNamed PHP Method

currentRouteNamed() public method

Determine if the current route matches a given name.
public currentRouteNamed ( string $name ) : boolean
$name string
return boolean
    public function currentRouteNamed($name)
    {
        return $this->current() ? $this->current()->getName() == $name : false;
    }

Usage Example

Example #1
0
 /**
  * Determine if the current route matches a given name.
  *
  * @param string $name
  * @return bool 
  * @static 
  */
 public static function currentRouteNamed($name)
 {
     return \Illuminate\Routing\Router::currentRouteNamed($name);
 }