qubus / router
Qubus Router is a powerful and fast PHP router for PSR-7/PSR-15 messages.
v3.0.2
2023-10-24 00:51 UTC
Requires
- php: >=8.2
- php-di/invoker: ^2
- qubus/http: ^3
- qubus/injector: ^3
- relay/relay: ^2
- spatie/macroable: ^1
Requires (Dev)
- mockery/mockery: ^1.3.1
- phpunit/phpunit: ^9.0
- qubus/qubus-coding-standard: ^1.1
- squizlabs/php_codesniffer: ^3.3.1
README
Qubus router is a powerful and fast PHP router for PSR-7/PSR-15 messages.
Features
- Basic routing (
GET
,HEAD
,POST
,PUT
,PATCH
,UPDATE
,DELETE
) with support for custom multiple HTTP verbs. - Regular expression constraints for parameters.
- Named routes.
- Generating url to routes.
- Route parameters.
- Optional route parameters.
- Route groups.
- PSR-7/PSR-15 Middlewares (classes that intercepts before the route is rendered) for routes, groups and controllers.
- Responsable objects.
- Domain/Subdomain routing
- Custom boot managers to rewrite urls
- Option to load routes from JSON file
- and more . . .
Requirements
- PHP 8.2+
Installation
composer require qubus/router
Rewrite Rules
Apache
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
</IfModule>
Nginx
location / {
try_files $uri /index.php;
}