p-router
p-router copied to clipboard
Create some commonly used regular expression patterns methods.
For convenience, some commonly used regular expression patterns have helper methods that allow you to quickly add pattern constraints to your routes:
example :
$router->get('/user/:id/:name', function () {
// ...
})->whereNumber('id')->whereAlpha('name');
If the incoming request does not match the route pattern constraints, an exception will be returned.