p-router icon indicating copy to clipboard operation
p-router copied to clipboard

Create some commonly used regular expression patterns methods.

Open DevAmirul opened this issue 2 years ago • 0 comments

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.

DevAmirul avatar Nov 12 '23 08:11 DevAmirul