Router

See url(), router(), route(), routeGroup()

Routes can be defined in any Provider:

public function routes() {
    return [
        new route('/foo', 'foo', \Foo\Controller\Bar::class),
        new route('/bar', 'bar', \Foo\Controller\Bar::class),
    ];
}

Groups

When sharing same parameters, they can be easily grouped:

public function routes() {
    return [
        routeGroup([
            'controller' => \Foo\Controller\Bar::class
        ])->routes([
            route('/foo', 'foo'),
            route('/bar', 'bar'),
        ])
    ];
}

Resolvers

Common usage is with named route parameters:

... and then implementing resolver:

Last updated

Was this helpful?