RouteCollectionBuilder
class RouteCollectionBuilder
Helps add and import routes into a RouteCollection.
Methods
Import an external routing resource and returns the RouteCollectionBuilder.
Adds a route and returns it for future modification.
Returns a RouteCollectionBuilder that can be configured and then added with mount().
Sets the host on all embedded routes (unless already set).
Sets a condition on all embedded routes (unless already set).
Sets a default value that will be added to all embedded routes (unless that default value is already set).
Sets a requirement that will be added to all embedded routes (unless that requirement is already set).
Sets an option that will be added to all embedded routes (unless that option is already set).
Sets the schemes on all embedded routes (unless already set).
Sets the methods on all embedded routes (unless already set).
Creates the final RouteCollection and returns it.
Details
RouteCollectionBuilder
import(mixed $resource, string|null $prefix = '/', string $type = null)
Import an external routing resource and returns the RouteCollectionBuilder.
$routes->import('blog.yml', '/blog');
Route
add(string $path, string $controller, string|null $name = null)
Adds a route and returns it for future modification.
RouteCollectionBuilder
createBuilder()
Returns a RouteCollectionBuilder that can be configured and then added with mount().
$this
setDefault(string $key, mixed $value)
Sets a default value that will be added to all embedded routes (unless that default value is already set).
$this
setRequirement(string $key, mixed $regex)
Sets a requirement that will be added to all embedded routes (unless that requirement is already set).
$this
setOption(string $key, mixed $value)
Sets an option that will be added to all embedded routes (unless that option is already set).
$this
setSchemes(array|string $schemes)
Sets the schemes on all embedded routes (unless already set).