{"id":19218693,"url":"https://github.com/fadilxcoder/php-pocketbase","last_synced_at":"2025-02-23T09:14:46.661Z","repository":{"id":249714146,"uuid":"830708837","full_name":"fadilxcoder/php-pocketbase","owner":"fadilxcoder","description":"Docker PHP SDK Pocketbase - API Server ","archived":false,"fork":false,"pushed_at":"2024-07-23T19:41:55.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-04T19:23:25.882Z","etag":null,"topics":["api","docker","php","pocketbase"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/fadilxcoder.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}},"created_at":"2024-07-18T20:25:44.000Z","updated_at":"2024-07-23T19:41:58.000Z","dependencies_parsed_at":"2024-07-22T23:19:31.261Z","dependency_job_id":"df5d8ee4-a269-4647-a908-63a8f8bd1a11","html_url":"https://github.com/fadilxcoder/php-pocketbase","commit_stats":null,"previous_names":["fadilxcoder/php-pocketbase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fphp-pocketbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fphp-pocketbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fphp-pocketbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadilxcoder%2Fphp-pocketbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadilxcoder","download_url":"https://codeload.github.com/fadilxcoder/php-pocketbase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240292395,"owners_count":19778311,"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":["api","docker","php","pocketbase"],"created_at":"2024-11-09T14:27:46.463Z","updated_at":"2025-02-23T09:14:46.614Z","avatar_url":"https://github.com/fadilxcoder.png","language":"Shell","readme":"# Pocketbase\n\n### Open Source backend for your next SaaS and Mobile app in 1 file\n\n- https://pocketbase.io/\n- https://pocketbase.io/docs/\n- Integration with docker using : https://pocketbase.io/docs/going-to-production/#using-docker\n- PHP SDK codebase : https://gitlab.jonathan-martz.de/softwareentwicklung/pocketbase-php-sdk\n\n---\n\n``` php\n// Example init and use\nuse \\Pb\\Client as pb;\n$pb = new pb('https://name_of_your_pocketbase_container_name:8080');\nvar_dump($pb-\u003ecollection('countries')-\u003egetList());\n```\n\n### Crud adapted from js-sdk to php\n\n**Returns a paginated records list.**\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003egetList(int $page = 1, int $perPage = 30, array $queryParams = []);\n```\n\n**Returns a list with all records batch fetched at once.**\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003egetFullList(int $batch = 200, array $queryParams = []);\n```\n\n**Returns the first found record matching the specified filter.**\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003egetFirstListItem(string $filter, array $queryParams = []);\n```\n\n**Returns a single record by its id.**\n```php\n\n$pb-\u003ecollection(collectionIdOrName)-\u003egetOne(string $recordId, array $queryParams = []);\n```\n\n**Creates (aka. register) a new record.**\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003ecreate(array  $bodyParams = [], array $queryParams = []);\n```\n```json\n{\n  \"name\" : \"Algerie\"\n}\n```\n\n**Updates an existing record by its id.**\n\nURL : `?id=y0eirw25xxxxxxxx`\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003eupdate(string $recordId, array $bodyParams = [],array $queryParams = []);\n```\n```json\n{\n  \"name\" : \"Lebanon\"\n}\n```\n\n**Deletes a single record by its id.**\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003edelete(string $recordId, array $queryParams = []);\n```\n\n**Custom Logic**\n```php\n$pb-\u003ecollection(collectionIdOrName)-\u003eupload(string $recordId, string $field, string $filepath);\n```\n---\n\n### Migrations\n\n- https://pocketbase.io/docs/js-migrations\n- Connect to `pktb_pocketbase`\n\n```bash\n/ # cd pb/\n/pb # ls\nCHANGELOG.md   LICENSE.md     pb_data        pb_migrations  pocketbase\n/pb # ./pocketbase  migrate create \"add_country_code\"\n? Do you really want to create migration \"pb_migrations/1721331064_add_country_code.js\"? Yes\nSuccessfully created file \"pb_migrations/1721331064_add_country_code.js\"\n/pb # \n```\n### App\n\n- App : http://localhost:8085/\n- Pocketbase : http://localhost:8185/_/#/\n- API endpoints : https://web.postman.co/workspace/IFX-Dev.~66822cb4-279f-4aeb-8486-23506f9657f0/collection/18647677-2f88e286-0b5b-49d8-9f2f-fba7616f85c4 \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadilxcoder%2Fphp-pocketbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadilxcoder%2Fphp-pocketbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadilxcoder%2Fphp-pocketbase/lists"}