{"id":36976029,"url":"https://github.com/erdum/php-weekend","last_synced_at":"2026-01-13T22:07:15.646Z","repository":{"id":181589881,"uuid":"666706636","full_name":"erdum/php-weekend","owner":"erdum","description":"A simple minimal set of functions provide you the ability to build API \u0026 web application with no setup time","archived":false,"fork":false,"pushed_at":"2025-05-14T19:51:53.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T12:04:48.553Z","etag":null,"topics":["hacktoberfest","laravel","php","php-library","php-package","php-router","php-router-standalone"],"latest_commit_sha":null,"homepage":"","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/erdum.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-15T09:59:29.000Z","updated_at":"2025-05-15T11:22:45.000Z","dependencies_parsed_at":"2023-10-02T10:58:39.754Z","dependency_job_id":"754f5843-47f8-4e4d-94a9-4278148fb4e0","html_url":"https://github.com/erdum/php-weekend","commit_stats":null,"previous_names":["erdum/php-weekend"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/erdum/php-weekend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdum%2Fphp-weekend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdum%2Fphp-weekend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdum%2Fphp-weekend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdum%2Fphp-weekend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdum","download_url":"https://codeload.github.com/erdum/php-weekend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdum%2Fphp-weekend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"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":["hacktoberfest","laravel","php","php-library","php-package","php-router","php-router-standalone"],"created_at":"2026-01-13T22:07:14.973Z","updated_at":"2026-01-13T22:07:15.640Z","avatar_url":"https://github.com/erdum.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PHP-Weekend\n\nA simple minimal set of functions provide you the ability to build API \u0026 web application with no setup time \u003cbr\u003e\n\n\u003cimg src=\"https://i.imgur.com/pLikazr.png\" width=\"700\" height=\"400\" /\u003e\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Feedback](#feedback)\n- [Contributors](#contributors)\n- [License](#license)\n\n## Features\n\n- Routing with dynamic routes\n- Templating\n- Method for accessing request data\n- Method for sending json data\n- Customizable\n- No design restriction build your API in anyway you want\n- Zero configuration\n\n\n## Installation\n\nInstall PHP-Weekend with composer\n\n```bash\ncomposer require erdum/php-weekend\n```\n\nOr install without composer on older PHP versions just copy the src directory and require the App.php and Router.php\n```php\n\u003c?php\n\nrequire(__DIR__ . '/src/App.php');\nrequire(__DIR__ . '/src/Router.php');\n\nuse PhpWeekend\\Router;\nuse PhpWeekend\\App;\n\nRouter::get('/', function() {\n    App::send_json(array('data' =\u003e 'Hello, World!'));\n});\n\nRouter::get('/simple', function() {\n    App::send_response('This is the content.', 200, 'text/html');\n});\n\nRouter::get('/get_pdf', function() {\n    App::send_file(__DIR__ . '/static/my_file.pdf');\n});\n```\n    \n## Usage\n\nAfter installing the package your project directory will have the following\n\n```bash\nls\n```\n- composer.json\n- composer.lock\n- vendor\n\nCreate an index.php file\n\n```php\n\u003c?php\n\nrequire(__DIR__ . '/vendor/autoload.php');\n\nuse PhpWeekend\\Router;\nuse PhpWeekend\\App;\n\nRouter::get('/', function() {\n    App::send_json(['data' =\u003e 'Hello, World!']);\n});\n\n/*\nRouter also have\npost\nput\npatch\ndelete\nany\n*/\n```\n\nYou can get request data submitted in any format with a single function\n- query Parameters\n- form-data\n- multipart/form-data\n- application/json\n\n```php\n\u003c?php\n\nrequire(__DIR__ . '/vendor/autoload.php');\n\nuse PhpWeekend\\Router;\nuse PhpWeekend\\App;\n\nRouter::post('/', function() {\n    $request_payload = App::get_request();\n\n    App::send_json(['data' =\u003e $request_payload], 201);\n});\n```\n\nYou can also build dynamic routes\n```php\n\u003c?php\n\nrequire(__DIR__ . '/vendor/autoload.php');\n\nuse PhpWeekend\\Router;\nuse PhpWeekend\\App;\n\nRouter::get('/user/$name', function($name) {\n    App::send_json(['data' =\u003e $name]);\n});\n```\n\nYou can also use templates create a directory called templates in your project root\n\n```bash\nmkdir templates\n```\ninside your templates directory you can build your templates like home.php\n\n```php\n\u003ch1\u003e\u003c?= $data ?\u003e\u003c/h1\u003e\n\u003ch2\u003e\u003c?= $foo ?\u003e\u003c/h2\u003e\n\n\u003c?php if ($age \u003e 18): ?\u003e\n    Hello\n\u003c?php else: ?\u003e\n    whatsapp\n\u003c?php endif; ?\u003e\n```\n\nnow you can render home.php template from your index file\n\n```php\n\u003c?php\n\nrequire(__DIR__ . '/vendor/autoload.php');\n\nuse PhpWeekend\\Router;\nuse PhpWeekend\\App;\n\nRouter::get('/', function() {\n    App::send_template('home', [\n        'data' =\u003e 'Hello, World!',\n        'foo' =\u003e 'bar',\n        'age' =\u003e 18\n    ]);\n});\n```\n\nApp also provides you the csrf functionality\n\n```php\n\u003cform\u003e\n    \u003cinput type=\"name\" name=\"user-name\"\u003e\n    \u003cinput type=\"email\" name=\"user-email\"\u003e\n    \u003c?= set_csrf() ?\u003e\n\u003c/form\u003e\n```\n\nnow verify the csrf token in the handler\n```php\n\u003c?php\n\nrequire(__DIR__ . '/vendor/autoload.php');\n\nuse PhpWeekend\\Router;\nuse PhpWeekend\\App;\n\nRouter::get('/', function() {\n\n    if (App::is_csrf_valid()) {\n        // CSRF token validated\n    }\n});\n```\n## Feedback\n\nIf you have any feedback, please reach out to us at erdumadnan@gmail.com\n\n## Contributors\n\n\u003ca href=\"https://github.com/erdum/php-weekend/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=erdum/php-weekend\" /\u003e\n\u003c/a\u003e\n\n## License\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdum%2Fphp-weekend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdum%2Fphp-weekend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdum%2Fphp-weekend/lists"}