public function build(): Route
    {
        if ($this->action === null) {
            throw new LogicException('No controller specified for route');
        }

        return new Route(
            $this->uriTemplate,
            $this->action,
            $this->constraints,
            $this->middlewareBindings,
            $this->name,
            $this->attributes
        );
    }
public function build(): Route
    {
        if ($this->action === null) {
            throw new LogicException('No controller specified for route');
        }

        return new Route(
            $this->uriTemplate,
            $this->action,
            $this->constraints,
            $this->middlewareBindings,
            $this->name,
            $this->attributes
        );
    }
public function build ( ) : Route { if ( $ this -> action === null ) { throw new LogicException ( 'No controller specified for route' ) ; } return new Route ( $ this -> uriTemplate , $ this -> action , $ this -> constraints , $ this -> middlewareBindings , $ this -> name , $ this -> attributes ) ; }
Builds a route object from all the settings in this builder

@return Route The built route
@throws LogicException Thrown if no controller was specified
Builds a route object from all the settings in this builder