Illuminate\Routing\Router::currentRouteName PHP Method

currentRouteName() public method

Get the current route name.
public currentRouteName ( ) : string | null
return string | null
    public function currentRouteName()
    {
        return $this->current() ? $this->current()->getName() : null;
    }

Usage Example

 protected function isResourceRoute()
 {
     if ($routeName = $this->router->currentRouteName()) {
         if (ends_with($routeName, ['.create', '.edit'])) {
             return TRUE;
         }
     }
     return FALSE;
 }
All Usage Examples Of Illuminate\Routing\Router::currentRouteName