1. Go to this page and download the library: Download pocketbase/sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pocketbase / sdk-php example snippets
use PocketBase\SDK\Client\PocketBaseClient;
use PocketBase\SDK\Query\QueryBuilder;
$pb = new PocketBaseClient('http://127.0.0.1:8090');
// Como admin (superuser)
$auth = $pb->authAsAdmin('[email protected]', 'password123');
// Como usuario de una colección
$auth = $pb->authWithPassword('users', '[email protected]', 'password');
// Verificar estado
if ($pb->isAuth()) {
echo "Autenticado";
}