{"id":20896593,"url":"https://github.com/luizeof/php-rest-api","last_synced_at":"2026-05-23T08:02:42.334Z","repository":{"id":141279600,"uuid":"231281500","full_name":"luizeof/php-rest-api","owner":"luizeof","description":"Easy way to create a PHP Rest API with Basic Authentication","archived":false,"fork":false,"pushed_at":"2020-01-02T15:27:27.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T20:11:39.641Z","etag":null,"topics":["api","auth","http","php","rest"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/luizeof/php-rest-api","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luizeof.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-02T00:43:25.000Z","updated_at":"2020-01-02T15:27:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"23374415-8435-45d2-8b10-451b1180c5f3","html_url":"https://github.com/luizeof/php-rest-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/luizeof/php-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizeof%2Fphp-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizeof%2Fphp-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizeof%2Fphp-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizeof%2Fphp-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luizeof","download_url":"https://codeload.github.com/luizeof/php-rest-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizeof%2Fphp-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33387656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"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":["api","auth","http","php","rest"],"created_at":"2024-11-18T10:36:06.549Z","updated_at":"2026-05-23T08:02:42.329Z","avatar_url":"https://github.com/luizeof.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-rest-api\n\nEasy way to create a PHP REST API with ```Basic Authentication```\n\n## Installing\n\nTo install `luizeof/php-rest-api`, run this command on your terminal:\n\n```bash\ncomposer require luizeof/php-rest-api\n```\n\n## Importing\n\nImport `autoload` on your project:\n\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n```\n\n## Sample Usage\n\n```php\n\u003c?php\n\ntry {\n\n    $api = luizeof\\RestAPI();\n\n    // Use this callback to make your username / password\n    // validation logic returning true or false\n    $api-\u003evalidate_auth( function() use ($api) {\n\n        if ($api-\u003eget_username() == \"luiz\") {\n            return true;\n        } else {\n            return false;\n        }\n\n    }); // validate_auth()\n\n    $arr = array('id' =\u003e 1, 'title' =\u003e \"Exemplo\", 'date' =\u003e \"01/01/2020\", 'tags'=\u003e array(\"php\",\"docker\",\"flutter\"), 'author' =\u003e \"luizeof\");\n\n    $api-\u003earray_to_json($arr);\n\n    $api-\u003erequest_success();\n\n} catch (Throwable $t) {\n\n    $api-\u003erequest_error($t);\n\n} catch (Exception $e) {\n\n    $api-\u003erequest_error($e);\n\n} finally {\n\n    unset($api);\n\n}\n\n?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizeof%2Fphp-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluizeof%2Fphp-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizeof%2Fphp-rest-api/lists"}