{"id":36252155,"url":"https://github.com/devamirul/p-router","last_synced_at":"2026-01-11T07:01:28.522Z","repository":{"id":199125567,"uuid":"701821446","full_name":"DevAmirul/p-router","owner":"DevAmirul","description":"A simple, lightweight, and powerful PHP Router with rich features like Middleware and Controllers. Heavily inspired by the way Laravel handles routing.","archived":false,"fork":false,"pushed_at":"2023-11-11T10:20:44.000Z","size":104,"stargazers_count":22,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T09:43:07.016Z","etag":null,"topics":["csrf-protection","middlewares","php-router","request-handler","router","routing-engine","url-handler"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/devamirul/p-router","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevAmirul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-07T16:53:08.000Z","updated_at":"2024-01-18T20:42:17.000Z","dependencies_parsed_at":"2023-10-28T15:31:34.527Z","dependency_job_id":"6faaefe9-a4d0-4495-8d9e-5fcc793757d2","html_url":"https://github.com/DevAmirul/p-router","commit_stats":null,"previous_names":["devamirul/p-router"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/DevAmirul/p-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevAmirul%2Fp-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevAmirul%2Fp-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevAmirul%2Fp-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevAmirul%2Fp-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevAmirul","download_url":"https://codeload.github.com/DevAmirul/p-router/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevAmirul%2Fp-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28296941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csrf-protection","middlewares","php-router","request-handler","router","routing-engine","url-handler"],"created_at":"2026-01-11T07:01:12.146Z","updated_at":"2026-01-11T07:01:28.511Z","avatar_url":"https://github.com/DevAmirul.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p-router\n\n```\n  _____            _____             _\n |  __ \\          |  __ \\           | |\n | |__)   ______  | |__) |___  _   _| |_ ___ _ __\n |  ___/ |______| |  _  // _ \\| | | | __/ _ \\ '__|\n | |              | | \\ \\ (_) | |_| | ||  __/ |\n |_|              |_|  \\_\\___/ \\__,_|\\__\\___|_|\n\n```\n\nA simple, lightweight, and powerful PHP Router with rich features like Middleware and Controllers. Heavily inspired by the way Laravel handles routing.\n\n## Features:\n\n- Supports `GET` `POST` `PUT` `PATCH` and `DELETE` HTTPS verbs\n- The methods that the router supports are :- `get()` `post()` `put()` `patch()` `delete()` `match()` `any()`\n- Named Routes\n- Regular expression constraints for parameters\n- Fallback method\n- Middleware\n- CSRF protection\n- Controller\n- Easy way to manage request\n- Helper methods\n- Command line interface(CLI)\n\n\n## Table of Contents:\n\n- **[Installation](#Installation)**\n- **[Examples](#Examples)**\n- **[Directories](#Directories)**\n- **[Routes](#Routes)**\n- **[Middlewares](#middlewares)**\n- **[CSRF Protection](#CSRF-Protection)**\n- **[Controllers](#Controllers)**\n- **[Request](#Request)**\n- **[Handle Html View Content File](#Handle-Html-View-Content-File)**\n- **[Handle Form](#Handle-Form)**\n- **[Helpers](#Helpers)**\n\n\n## Installation:\n\nInstallation is possible using Composer.\n\n```bash\ncomposer require devamirul/p-router\n```\nAdd the following script to `composer.json` file:\n\n```json\n\"autoload\": {\n    \"psr-4\": {\n        \"App\\\\\": \"app/\"\n    }\n},\n\"scripts\": {\n    \"start\": [\n        \"php -S 127.0.0.1:8000\"\n    ],\n    \"middleware\": \"cd vendor/devamirul/p-router/src/CLI \u0026\u0026 php createMiddleware.php \u0026\u0026 cd -\",\n    \"controller\": \"cd vendor/devamirul/p-router/src/CLI \u0026\u0026 php createController.php \u0026\u0026 cd -\",\n    \"app\": \"cd vendor/devamirul/p-router/src/CLI \u0026\u0026 php createApp.php \u0026\u0026 cd -\"\n}\n```\n\nRun the following command:\n\n```bash\ncomposer dump-autoload\n```\n\nCreate `app` folder.\n\n```bash\ncomposer app\n```\n\nStart PHP server.\n\n```bash\ncomposer start\n```\n\n## Examples:\n\n#### Basic route:\n\n```php\n$router-\u003eget('/', function () {\n    echo 'welcome to p-route';\n})-\u003ename('home');\n```\n\nor\n\n```php\n$router-\u003eget('/', [WelcomeController::class, 'index'])-\u003ename('home');\n```\n\n#### Dynamic Route:\n\n```php\n$router-\u003eget('/users/:id', function(){\n    //\n})-\u003ewhere(['id' =\u003e '^\\d+$'])-\u003ename('user');\n```\n\n#### Middleware:\n\n```php\n$router-\u003eget('/users/:id', function(){\n    //\n})-\u003emiddleware('auth')-\u003ewhere(['id' =\u003e '^\\d+$'])-\u003ename('user');\n```\n**You can do method chaining if you want.**\n\n\n## Directories:\n\n`app/config`: This folder contains system config files. Make your changes only in the config file.\n\n`app/Middlewares`: Create your custom middlewares in this folder.\n\n`app/Controllers`: Create your custom controllers in this folder.\n\n\n## Routes:\n\n### Available Router Methods:\n\nThe router allows you to register routes that respond to any HTTP verb:\n\n```php\n$router-\u003eget($uri, $callback);\n$router-\u003epost($uri, $callback);\n$router-\u003eput($uri, $callback);\n$router-\u003epatch($uri, $callback);\n$router-\u003edelete($uri, $callback);\n$router-\u003ematch($uri, $callback);\n$router-\u003eany($uri, $callback);\n```\n\n### Basic Routes:\n\nRoutes accept a URI and a closure or a array, providing a very simple and expressive method of defining routes and behavior without complicated routing configuration files.\n\n1. First create index.php file.\n2. Define Application root path.\n3. Require vendor autoload file.\n4. Create `router` singleton instance.\n5. Define routes.\n6. Run the application via the `run()` method.\n\n```php\n\u003c?php\n/**\n * Define root directory.\n */\ndefine('APP_ROOT', dirname(__FILE__));\n\n/**\n * Require composer autoloader.\n */\nrequire __DIR__ . '/vendor/autoload.php';\n\n// Get singleton route instance.\n$router = Devamirul\\PRouter\\Router::singleton();\n\n// Define routes.\n$router-\u003eget('/greeting', function () {\n    return 'Hello World';\n});\n\n// Resolve and run application.\n$router-\u003erun();\n?\u003e\n```\n\nOr create a separate `route.php` file and include that file in the `index.php` file.\n\nFirst create route.php or name the file according to your choice:\n\n```php\n\u003c?php\n\n// Define routes\n$router-\u003eget('/greeting', function () {\n    return 'Hello World';\n});\n\n$router-\u003efallback(function () {\n    return 'Fallback route';\n});\n\n?\u003e\n```\n\nInclude route.php in the `index.php` file:\n\n```php\n/**\n * Require composer autoloader.\n */\nrequire __DIR__ . '/vendor/autoload.php';\n\n// Get singleton route instance.\n$router = Devamirul\\PRouter\\Router::singleton();\n\n// Require route.php\nrequire_once './route.php';\n\n// Resolve and run application.\n$router-\u003erun();\n```\n\nLet's discuss the second parameter. The second parameter accepts a closure or an array of key value pairs. The 'key' of the array will be a class and the value will be a method of the class, the method will be invoked by the class.\n\n```php\nuse App\\Controllers\\WelcomeController;\n\n$router-\u003eget('/', [WelcomeController::class, 'index'])-\u003ename('home');\n```\n\n**Use return instead of echo.**\n\n```php\n// Right way.\n$router-\u003eget('/greeting', function () {\n    return 'Hello World';\n});\n\n// wrong way.\n$router-\u003eget('/greeting', function () {\n    echo 'Hello World';\n});\n```\n\n\u003c!-- ### Enable case sensitive routes:\n\nBy default router case sensitive mode is enabled.\nThe third parameter of route is set to true by default. You can disable case sensitive mode by setting the second parameter to false:\n\n```php\n$router-\u003eget('/', [WelcomeController::class, 'index'], false)-\u003ename('home');\n``` --\u003e\n\n### Named Routes:\n\nNamed routes allow the convenient generation of URLs or redirects for specific routes. You may specify a name for a route by chaining the name method onto the route definition:\n\n**Route names should always be unique.**\n\n```php\n$router-\u003eget('/user/profile', function () {\n    // ...\n})-\u003ename('profile');\n```\n\n#### Generating URLs To Named Routes\n\nOnce you assign a name to a given route, you can redirect via `toRoute()`:\n\n```php\nreturn toRoute('profile');\n```\n\nIf the named route defines parameters, you may pass the parameters as the second argument to the `toRoute` function. The given parameters will automatically be inserted into the generated URL in their correct positions:\n\n```php\n$router-\u003eget('/user/:id/profile', function () {\n    // ...\n})-\u003ename('profile');\n\nreturn toRoute('profile', ['id' =\u003e 1]);\n```\n\nIf you pass additional parameters in the array, those key / value pairs will automatically be added to the generated URL's query string:\n\n```php\n$router-\u003eget('/user/:id/profile', function () {\n    // ...\n})-\u003ename('profile');\n\nreturn toRoute('profile', ['id' =\u003e 1, 'photos' =\u003e 'yes']);\n```\n**If you use an asterisk (*) in the route, you cannot call it via `toRoute()`.**\n\n\n### Route Parameters:\n\n#### Required Parameters:\n\nSometimes you will need to capture segments of the URI within your route. For example, you may need to capture a user's ID from the URL. You can get it through `$request-\u003egetParam()` method.\n\n```php\n$router-\u003eget('/user/:id', function (Request $request) {\n    return 'User ' . $request-\u003egetParam('id');\n});\n```\n\nYou may define as many route parameters as required by your route:\n\n```php\n$router-\u003eget('/posts/:post/comments/:comment', function (Request $request) {\n    //Get all parameters array.\n    return 'User ' . $request-\u003egetParam();\n\n    //Get specific parameter.\n    return 'User ' . $request-\u003egetParam('post');\n});\n```\n\nRoute parameters will always start with Colon ':' and should contain alphanumeric characters.\n\n#### Parameters:\n\nAutomatically get 'Request' instances in your route callback or controller.\n\nIn callback:\n\n```php\n$router-\u003eget('/user/:id', function (Request $request) {\n    return 'User ' . $request-\u003egetParam('id');\n});\n```\nIn controller:\n\n```php\n$router-\u003eget('/user/:id', [UserController::class, 'index']);\n```\n\n```php\nnamespace App\\Http\\Controllers;\n\nuse Devamirul\\PhpMicro\\core\\Foundation\\Application\\Request\\Request;\nuse Devamirul\\PhpMicro\\core\\Foundation\\Controller\\BaseController;\n\nclass UserController extends BaseController {\n    public function index(Request $request) {\n        return 'User ' . $request-\u003egetParam('id');\n    }\n}\n```\n\n#### Optional Parameters:\n\nOccasionally you may need to specify a route parameter that may not always be present in the URI. You may do so by placing a question sign  `?` mark after the parameter:\n\n**It is important to note that optional parameter are always placed at the end of the URLs.**\n\n```php\n$router-\u003eget('/user/:name?', function () {\n    //\n});\n```\n\n#### Regular Expression Constraints:\n\nYou can restrict the format of your route parameter by using the `where` method on a route instance.\nThe `where()` method takes a regular expression as parameter which determines how the parameter should be delimited. The \"where()\" method will accept the serialized parameters of the router's dynamic parameters:\n\n```php\n$router-\u003eget('/user/:id', function () {\n    // ...\n})-\u003ewhere(['id' =\u003e '^\\d+$']);\n```\n\nRegular expression constraints for optional parameter:\n\n```php\n$router-\u003eget('/user/:name?', function () {\n    //\n})-\u003ewhere(['name' =\u003e '^[a-zA-Z ]*$']);\n```\n\nRegular expression constraints for multiple optional parameters:\n\n```php\n$router-\u003eget('/profile/:id/user/:name?', function () {\n    //\n})-\u003ewhere(['id' =\u003e '^\\d+$', 'name' =\u003e '^[a-zA-Z ]*$']);\n```\n\n### match and any method\n\nSometimes you may need to register a route that responds to multiple HTTP verbs. You may do so using the match method. Or, you may even register a route that responds to all HTTP verbs using the any method:\n\n```php\n$router-\u003ematch(['get', 'post'], '/', function () {\n    // ...\n});\n\n$router-\u003eany('/', function () {\n    // ...\n});\n```\n\n### Route wildcard:\n\nYou can use dynamic routes using asterisks:\n\n```php\n$router-\u003eget('admin/*', function () {\n    // ...\n});\n```\n\nIn the example above, you can dynamically use any path after `admin/`. The asterisk is used as a wildcard and matches any combination of characters.\n\n\u003c!-- ### Redirect Routes:\n\nIf you are defining a route that redirects to another URI, you may use the `redirect()` method. This method provides a convenient shortcut so that you do not have to define a full route\n\n```php\n$router-\u003eredirect('/here', '/there');\n``` --\u003e\n\n## Middlewares:\n\n`app/Middlewares`: Middleware provides a convenient mechanism for inspecting and filtering HTTP requests entering your application.\n\nThe predefined middleware files are:- `AuthMiddleware.php` `CsrfMiddleware.php`\n\n\u003cem\u003e**By default you will get a request instance in the handle method.**\u003c/em\u003e\n\n### Make middleware:\n\nTo create a new middleware, use the `composer middleware` command:\n\n```cli\ncomposer middleware\n```\n\nThe command line interface will ask you for a middleware name, you enter a name. It will automatically add \"Middleware\" to the name you provided. For example, you want to create a middleware named \"example\". Then your middleware class will be `ExampleMiddleware.php`\n\n\n```php\nnamespace App\\Middlewares;\n\nuse Devamirul\\PRouter\\Interfaces\\Middleware;\nuse Devamirul\\PRouter\\Request\\Request;\n\nclass AuthMiddleware implements Middleware {\n    /**\n     * Handle an incoming request.\n     */\n    public function handle(Request $request): void {\n        //\n    }\n}\n```\n\nFor example, This framework includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to your application's login screen. However, if the user is authenticated, the middleware will allow the request to proceed further into the application.\n\n```php\npublic function handle(Request $request): void {\n    if (!isset($_SESSION['user'])) {\n        redirect('/login');\n    }\n    return;\n}\n```\n### Add middleware\n\nAfter creating the middleware add it to the middleware array in the 'app/config/middleware.php' file.\nAdd your own middleware to this list and assign it an alias of your choice:\n\n```php\n'middleware' =\u003e [\n    'csrf' =\u003e Devamirul\\PRouter\\Middleware\\Middlewares\\CsrfMiddleware::class,\n    'auth' =\u003e App\\Middlewares\\AuthMiddleware::class\n],\n```\n\nIf you would like to assign middleware to specific routes, you may invoke the middleware method when defining the route.\nOnce the middleware alias is defined, you use the alias when assigning middleware to routes:\n\n```php\nRouter::get('/users/:id', function(){\n    //\n})-\u003emiddleware('auth');\n```\n\nYou can assign multiple middleware at once if you want:\n\n```php\nRouter::put('/users/:id', function(){\n    //\n})-\u003emiddleware(['auth','csrf']);\n```\n\n#### Set default middlewares:\n\nIf you want to set some middleware to Https verbs by default, you can do that very easily, The defined middleware will run when that https method request is handled:\n\nOpen `app/config/middleware.php`\n\n```php\n'get'        =\u003e [],\n'post'       =\u003e [ 'csrf' ],\n'put'        =\u003e [ 'csrf' ],\n'patch'      =\u003e [ 'csrf' ],\n'delete'     =\u003e [ 'csrf', 'auth' ],\n```\n\n## CSRF Protection:\n\nAnytime you define a \"POST\", \"PUT\", \"PATCH\", or \"DELETE\" HTML form in your application, you should include a hidden CSRF _token field in the form so that the CSRF protection middleware can validate the request, Otherwise, the request will be rejected. For convenience, you may use the `setCsrf()` function to generate the hidden token input field:\n\n\n```php\n\u003cform method=\"POST\" action=\"/profile\"\u003e\n    \u003c?=setCsrf()?\u003e\n    ...\n\u003c/form\u003e\n```\n\n## Controllers:\n\n`app/Controllers`: Controllers respond to user actions (submitting forms, show users, view data, and any action etc.). Controllers are classes that extend the BaseController class.\n\n\u003cem\u003e**By default you will get request instance in each method.**\u003c/em\u003e\n\n### Make controller\n\nTo create a new controller, use the `composer controller` command:\n\n```cli\ncomposer controller\n```\nThe command line interface will ask you for a controller name, you enter a name. It will automatically add \"Controller\" to the name you provided. For example you want to create a controller named \"example\". Then your controller class will be `ExampleController.php`\n\n```php\nnamespace App\\Controllers;\n\nuse Devamirul\\PRouter\\Request\\Request;\nuse Devamirul\\PRouter\\Controller\\BaseController;\n\nclass UserController extends BaseController {\n    /**\n     * Show user.\n     */\n    public function show(Request $request) {\n        return 'user name -' . $request-\u003einput('name');\n    }\n}\n```\n\n## Request:\n\nFramework's Request class provides an object-oriented way to interact with the current HTTP request being handled by your application as well as retrieve the input that were submitted with the request.\n\n#### Accessing The Request:\n\nYou can get request instance through the request helper function:\n\n```php\n// Get all input data.\nrequest()-\u003eall();\n```\n\n```php\n// Get all input data.\nrequest()-\u003einput();\n\n// Get input data specified by key, return default data if key not found.\nrequest()-\u003einput('name', 'default');\n\n// Get input data specified by key.\nrequest()-\u003eonly('name', 'email');\n\n// Get path.\nrequest()-\u003epath();\n\n// Get all query.\nrequest()-\u003equery();\n\n// Get query data specified by key.\nrequest()-\u003equery('name');\n\n// Get current method.\nrequest()-\u003emethod();\n\n// Get all input data.\nrequest()-\u003eall();\n\n// Get dynamic params.\nrequest()-\u003egetParam();\n\n// Get specific param.\nrequest()-\u003egetParam('id');\n```\n\nAlso you will get methods.\n\n`isGet()` `isPost()` `isPut()` `isPatch()` `isDelete()`\n\n\n## Handle Html View Content File:\n\nYou can easily view `html content` from a controller or callback function.\n\nSimply `require' the file you want to view:\n\n```php\n$router-\u003eget('/', function () {\n    require_once './home.php';\n});\n```\nIn Content file:\n\n```php\n\u003cbody\u003e\n    \u003ch1\u003eHome Page\u003c/h1\u003e\n\u003c/body\u003e\n```\n\nYou can easily view the data in the `content` file:\n\n```php\n$router-\u003eget('/', function (Request $request) {\n    $name = 'Amirul islam';\n\n    require_once './home.php';\n});\n```\nIn Content file:\n\n```php\n\u003cbody\u003e\n    \u003ch1\u003eWelcome Mr \u003c?= $name ?\u003e \u003c/h1\u003e\n\n    \u003c?php\n        foreach ($request-\u003einput() as $value) {\n            echo $value;\n        }\n    ?\u003e\n\u003c/body\u003e\n```\n\n## Handle Form:\n\n```php\n\u003cform action=\"/login\" method=\"POST\" class=\"mt-5\"\u003e\n\n    \u003c?=setCsrf()?\u003e\n\n    \u003cdiv class=\"mb-3\"\u003e\n        \u003clabel for=\"exampleInputEmail\" class=\"form-label\"\u003eEmail address\u003c/label\u003e\n        \u003cinput type=\"email\" name=\"email\" class=\"form-control\" id=\"exampleInputEmail\" aria-describedby=\"emailHelp\"\u003e\n        \u003cdiv id=\"emailHelp\" class=\"form-text\"\u003e \u003c?= errors('email')?\u003e \u003c/div\u003e\n    \u003c/div\u003e\n\n    \u003cdiv class=\"mb-3\"\u003e\n        \u003clabel for=\"exampleInputPassword\" class=\"form-label\"\u003ePassword\u003c/label\u003e\n        \u003cinput type=\"password\" name=\"password\" class=\"form-control\" id=\"exampleInputPassword\"\u003e\n        \u003cdiv id=\"emailHelp\" class=\"form-text\"\u003e \u003c?= errors('password')?\u003e \u003c/div\u003e\n    \u003c/div\u003e\n\n    \u003cbutton type=\"submit\" class=\"btn btn-primary\"\u003eLogin\u003c/button\u003e\n\u003c/form\u003e\n```\n\n### Method Field:\n\nSince HTML forms can't make PUT, PATCH, or DELETE requests, you will need to add a hidden `_method` field to spoof these HTTP verbs. The `setMethod()` Blade directive can create this field for you:\n\n```php\n\u003cform\u003e\n    \u003c?=setMethod('delete')?\u003e\n    ...\n\u003c/form\u003e\n```\n\n## Helpers:\n\n### Table of Contents\n\n- **[General Helpers](#General-Helpers)**\n- **[Form Helpers](#Form-Helpers)**\n- **[Request Helpers](#Request-Helpers)**\n- **[Response Helpers](#Response-Helpers)**\n\n\n### General Helpers:\n\nGet config data:\n```php\nconfig('app', 'timezone');\n```\nView the data in details then exit the code:\n```php\ndd([1,2,3]);\n```\nView the data in details:\n```php\ndump();\n```\n\n### Form Helpers:\n\nSet new CSRF value:\n```php\nsetCsrf();\n```\nExample:\n```php\n\u003cform\u003e\n    \u003c?=setCsrf()?\u003e\n\u003c/form\u003e\n```\nCheck CSRF is valid or not, return bool:\n```php\nisCsrfValid();\n```\nSet form method, like put/patch/delete:\n```php\nsetMethod();\n```\nExample:\n```php\n\u003cform\u003e\n    \u003c?=setMethod('delete')?\u003e\n\u003c/form\u003e\n```\n\n### Request Helpers:\n\n**Get request instance**\n```php\nrequest();\n```\nExample:\n```php\nrequest()-\u003einput();\n```\n\n### Response Helpers:\n\nRedirect link:\n```php\nreturn redirect('/redirect-link');\n```\n\nFinds route by route name and redirect this route:\n```php\nreturn toRoute('users');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevamirul%2Fp-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevamirul%2Fp-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevamirul%2Fp-router/lists"}