{"id":29197519,"url":"https://github.com/selviler/php-project-jwt","last_synced_at":"2025-07-02T07:09:48.412Z","repository":{"id":108627606,"uuid":"350029485","full_name":"selviler/php-project-jwt","owner":"selviler","description":"rest api example with php","archived":false,"fork":false,"pushed_at":"2024-01-10T14:17:47.000Z","size":56,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T11:24:45.541Z","etag":null,"topics":["jwt-token","mysql","mysql-database","php","php-package","rest-api"],"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/selviler.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}},"created_at":"2021-03-21T14:54:21.000Z","updated_at":"2024-01-10T17:50:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"92b08643-c557-4f3d-92b1-5a63d64cec3e","html_url":"https://github.com/selviler/php-project-jwt","commit_stats":null,"previous_names":["slvler/php-rest-api","slvler/php-project-jwt","selviler/php-project-jwt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/selviler/php-project-jwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selviler%2Fphp-project-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selviler%2Fphp-project-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selviler%2Fphp-project-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selviler%2Fphp-project-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selviler","download_url":"https://codeload.github.com/selviler/php-project-jwt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selviler%2Fphp-project-jwt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263091127,"owners_count":23412359,"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":["jwt-token","mysql","mysql-database","php","php-package","rest-api"],"created_at":"2025-07-02T07:09:47.861Z","updated_at":"2025-07-02T07:09:48.379Z","avatar_url":"https://github.com/selviler.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP- CRUD - Rest API\n\nSingle file PHP script that adds a REST API to a MySQL database. \n\n## Requirements\n\n  - PHP 7.0 or higher with PDO drivers enabled for one of these database systems:\n  - MySQL 5.6 / MariaDB 10.0 or higher for spatial features in MySQL\n\n## Configuration\n\nEdit the following lines in the bottom of the file \"`login.php`\" and \"`Item.php`\":\n\n    $vt = $this-\u003eDatabase(\n        \"Database\",\n        \"localhost\",\n        \"stable\",\n        \"root\",\n        \"\"\n    );\n\n\n    \n## Features\n\nThe following features are supported:\n\n  - JWT installment\n  - ElastichSearch V2\n\n\n### LOGIN CRUD\n\nThe example login table has only a a few fields:\n\n    post  \n    =======\n    /login     \n    /login/all  \n    /login/single\n    /login/register\n    /login/update\n    /login/delete\n\nThe CRUD + List operations below act on this table.\n\n\n#### Login\n\nTo read a record from this table the request can be written in URL format as:\n\n    POST /login\n\nHeaders\n\n    Content-Type : application/json\n\nBody-raw / Json request\n\n    {\n        \"email\" : \"deneme@gmail.com\",\n        \"password\" : \"123456\",\n        \"apikey\" : \"12\"\n\n    }\n\nWhere \"1\" is the value of the primary key of the record that you want to read. It will return:\n\n    {\n        \"status\":1,\n        \"jwt\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3QiLCJpYXQiOjE2NDY5NDE2MjMsIm5iZiI6MTY0Njk0MTYzMywiZXhwIjoxNjQ2OTQ1MjIzLCJhdWQiOiJteWxvZ2luIiwiZGF0YSI6eyJpZCI6IjEiLCJlbWFpbCI6ImRlbmVtZUBnbWFpbC5jb20iLCJteWFwaWtleSI6IjEyIn19.5ZFqcYSADVaG0BoFBNtxl5nfjCR7d3Wn8JZ0ra-PcJ8\",\"message\":\"Succesful\"\n    \n    }\n\nOn login operations.\n\n\n#### Create\n\nTo read a record from this table the request can be written in URL format as:\n\n    POST /login/register\n\nHeaders\n\n    Content-Type : application/json\n    Authorization : Login JWt \n\nBody-raw / Json request\n\n    {\n        \"email\":\"example@example.com\",\n        \"password\":\"123456\",\n        \"apikey\":\"555\",\n        \"status\":\"1\",\n        \"myapi\":\"12\",\n        \"secret\":\"stableDeneme\"\n\n    }\n\nWhere \"1\" is the value of the primary key of the record that you want to read. It will return:\n\n    {\n    \n        \"status\":1,\n        \"message\":\"Succesful\"\n    \n    }\n\nOn create operations.\n\n\n#### Read - Single\n\nTo read a record from this table the request can be written in URL format as:\n\n    POST /login/single\n\nHeaders\n\n    Content-Type : application/json\n    Authorization : Login JWT\n\nBody-raw / Json request\n\n    {\n        \"id\" : \"11\",\n        \"myapi\" : \"12\",\n        \"secret\" : \"stableDeneme\"\n\n    }\n\nWhere \"1\" is the value of the primary key of the record that you want to read. It will return:\n\n    {\n        \"status\":1,\n        \"data\":{\n            \"login_id\":\"11\",\n            \"login_email\":\"example@example.com\",\n            \"login_pass\":\"7c4a8d09ca3762af61e59520943dc26494f8941b\",\n            \"login_apikey\":\"555\",\n            \"login_status\":\"1\"\n            },\n        \"message\":\"Succesful\"\n    }\n\nOn single read operations.\n\n\n#### List\n\nTo read a record from this table the request can be written in URL format as:\n\n    POST /login/all\n\nHeaders\n\n    Content-Type : application/json\n    Authorization : Login JWT\n\nBody-raw / Json request\n\n    {\n        \"myapi\" : \"12\",\n        \"secret\" : \"stableDeneme\"\n\n    }\n\nWhere \"1\" is the value of the primary key of the record that you want to read. It will return:\n\n    {\n        \"status\": 1,\n        \"data\": [\n            {\n                \"login_id\": \"1\",\n                \"login_email\": \"deneme@gmail.com\",\n                \"login_pass\": \"7c4a8d09ca3762af61e59520943dc26494f8941b\",\n                \"login_apikey\": \"12\",\n                \"login_status\": \"1\"\n            },\n            {\n                \"login_id\": \"10\",\n                \"login_email\": \"tamamdır@gmail\",\n                \"login_pass\": \"7c4a8d09ca3762af61e59520943dc26494f8941b\",\n                \"login_apikey\": \"998\",\n                \"login_status\": \"1\"\n            },\n            {\n                \"login_id\": \"11\",\n                \"login_email\": \"example@example.com\",\n                \"login_pass\": \"7c4a8d09ca3762af61e59520943dc26494f8941b\",\n                \"login_apikey\": \"555\",\n                \"login_status\": \"1\"\n            }\n        ],\n                \"message\": \"Succesful\"\n    }\n\nOn read operations.\n\n\n#### Update\n\n\nTo read a record from this table the request can be written in URL format as:\n\n    POST /login/update\n\nHeaders\n\n    Content-Type : application/json\n    Authorization : Login JWT\n\nBody-raw / Json request\n\n    {\n         \"id\": \"11\",\n         \"email\": \"example@example.com\",\n         \"password\": \"555666777\",\n         \"apikey\": \"555\",\n         \"status\": \"1\",\n         \"myapi\":\"12\",\n         \"secret\":\"stableDeneme\"\n    }\n\nWhere \"1\" is the value of the primary key of the record that you want to read. It will return:\n\n    {\n\n        \"status\": 1,\n        \"message\": \"Succesful\"\n    \n    }\n\nOn update operations.\n\n\n#### Delete\n\nTo read a record from this table the request can be written in URL format as:\n\n    POST /login/delete\n\nHeaders\n\n    Content-Type : application/json\n    Authorization : Login JWT\n\nBody-raw / Json request\n\n    {\n         \"id\" : \"10\",\n         \"myapi\" : \"12\",\n         \"secret\" : \"stableDeneme\"\n    }\n\nWhere \"1\" is the value of the primary key of the record that you want to read. It will return:\n\n    {\n\n        \"status\": 1,\n        \"message\": \"Succesful\"\n    \n    }\n\nOn delete operations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselviler%2Fphp-project-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselviler%2Fphp-project-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselviler%2Fphp-project-jwt/lists"}