{"id":20085433,"url":"https://github.com/mkgor/pointsman","last_synced_at":"2026-05-08T12:49:25.649Z","repository":{"id":96983051,"uuid":"278055032","full_name":"mkgor/pointsman","owner":"mkgor","description":"Laravel-like router for your project","archived":false,"fork":false,"pushed_at":"2020-07-08T19:00:00.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T02:17:17.104Z","etag":null,"topics":["laravel-like","php7","router"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkgor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-08T10:05:39.000Z","updated_at":"2022-02-12T13:05:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed3bde23-e9d1-4b42-bdc7-529fe9185164","html_url":"https://github.com/mkgor/pointsman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fpointsman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fpointsman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fpointsman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fpointsman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkgor","download_url":"https://codeload.github.com/mkgor/pointsman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241518083,"owners_count":19975378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["laravel-like","php7","router"],"created_at":"2024-11-13T15:55:55.190Z","updated_at":"2026-05-08T12:49:20.599Z","avatar_url":"https://github.com/mkgor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pointsman\n\nLaravel-like routing for your project\n\n# Installation\n\n`composer require mkgor/pointsman`\n\n# Usage\n\n#### Specifying routes\n````php\n\u003c?php\n\nuse Pointsman\\Pointsman;\n\nPointsman::get('getUserById', '/api/user/get/[id]', 'ApiController::getUserById');\nPointsman::post('createUser', '/api/user/create', 'ApiController::createUser');\nPointsman::update('editUserById', '/api/user/edit/[id]', 'ApiController::editUserById');\nPointsman::delete('deleteUserById', '/api/user/delete/[id]', function ($id) {\n    //deleting user\n});\n\n//You can use any PSR-7 compatible request\nPointsman::handleUrl(Laminas\\Diactoros\\ServerRequestFactory::fromGlobals(\n    $_SERVER,\n    $_GET,\n    $_POST,\n    $_COOKIE,\n    $_FILES\n));\n````\n\n#### Using prefix\n````php\n\u003c?php\n\nuse Pointsman\\Pointsman;\n\nPointsman::prefix('api', function() {\n    Pointsman::get('getUserById', '/user/get/[id]', 'ApiController::getUserById');\n    Pointsman::post('createUser', '/user/create', 'ApiController::createUser');\n    Pointsman::update('editUserById', '/user/edit/[id]', 'ApiController::editUserById');\n    Pointsman::delete('deleteUserById', '/user/delete/[id]', 'ApiController::deleteUserById');\n});\n\n//You can use any PSR-7 compatible request\nPointsman::handleUrl(Laminas\\Diactoros\\ServerRequestFactory::fromGlobals(\n    $_SERVER,\n    $_GET,\n    $_POST,\n    $_COOKIE,\n    $_FILES\n));\n````\n\n#### Dumping routes\n````php\n\u003c?php\n\n//.... defining routes\n\necho Pointsman::dumpRoutes();\n````\n\n#### Parameter types\n\n````php\n\u003c?php\n\nuse Pointsman\\Pointsman;\n\n// [ ] - means that parameter is required\nPointsman::get('getUserById', '/user/get/[id]', 'ApiController::getUserById');\n\n// ( ) - parameter is not required\nPointsman::update('editUserById', '/user/edit/(id)', 'ApiController::editUserById');\n\n// You also can specify custom regular expression for parameter\nPointsman::delete('deleteUserById', '/user/delete/[id:\\d+]', 'ApiController::deleteUserById');\n````\n\n#### Getting route info\n\n````php\n\u003c?php\n\nuse Pointsman\\Pointsman;\n\nPointsman::get('getUserById', '/user/get/[id]', function($id) {\n    //Pointsman::$currentRoute contains all information about current route\n    var_dump(Pointsman::$currentRoute);\n});\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkgor%2Fpointsman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkgor%2Fpointsman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkgor%2Fpointsman/lists"}