No description
  • PHP 87.4%
  • Go 12.6%
Find a file
jonathan-martz f2c2e1041b update readme
2026-02-20 23:00:54 +01:00
.github/workflows workflow one time per day 2025-01-12 18:55:44 +01:00
src #8 - fix header json 2025-09-02 19:49:49 +02:00
tests refactoring collection a little bit, adjust token from collection manual,write some test for the simple logic, fixing superusers authAdmin 2025-01-21 23:52:11 +01:00
.gitignore add compsoer lock with gitingore 2025-01-12 11:59:02 +01:00
composer.json add php unit with json printer 2025-01-12 11:57:45 +01:00
composer.lock composer update 2026-02-20 22:59:10 +01:00
mailer.go fix mailer go 2025-01-12 19:22:11 +01:00
phpunit.xml add phpunit config 2025-01-12 11:58:26 +01:00
README.md update readme 2026-02-20 23:00:54 +01:00

Php Sdk for Pocketbase


This Repository are in active Development


Gitlab is the one for Packagist, but they should both be up to Date.

Github: https://github.com/jonathan-martz/pocketbase-php-sdk/
Forgejo: https://git.jmse.cloud/jonathan-martz/pocketbase-php-sdk

composer require jonathan-martz/pocketbase-php-sdk
// Example init and use
use \Pb\Client as pb;
$pb = new pb('http://localhost:8090');
var_dump($pb->collection('users')->getList());

Crud adapted from js-sdk to php

// Returns a paginated records list.
$pb->collection(collectionIdOrName)->getList(int $page = 1, int $perPage = 30, array $queryParams = []);

// Returns a list with all records batch fetched at once.
$pb->collection(collectionIdOrName)->getFullList(int $batch = 200, array $queryParams = []);

// Returns the first found record matching the specified filter.
$pb->collection(collectionIdOrName)->getFirstListItem(string $filter, array $queryParams = []);

// Returns a single record by its id.
$pb->collection(collectionIdOrName)->getOne(string $recordId, array $queryParams = []);

// Creates (aka. register) a new record.
$pb->collection(collectionIdOrName)->create(array  $bodyParams = [], array $queryParams = []);

// Updates an existing record by its id.
$pb->collection(collectionIdOrName)->update(string $recordId, array $bodyParams = [],array $queryParams = []);

// Deletes a single record by its id.
$pb->collection(collectionIdOrName)->delete(string $recordId, array $queryParams = []);

// Custom Logic
$pb->collection(collectionIdOrName)->upload(string $recordId, string $field, string $filepath);