1. Go to this page and download the library: Download edgebase/admin 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/ */
edgebase / admin example snippets
use EdgeBase\Admin\AdminClient;
$admin = new AdminClient(
'https://your-project.edgebase.fun',
getenv('EDGEBASE_SERVICE_KEY') ?: ''
);
$users = $admin->adminAuth->listUsers(limit: 20);
$postRows = $admin->sql(
'shared',
null,
'SELECT id, title FROM posts WHERE status = ?',
['published']
);
$bucket = $admin->storage->bucket('avatars');
$bucket->upload('user-1.jpg', 'binary-data', contentType: 'image/jpeg');
$admin->push()->send('user-1', [
'title' => 'Deployment finished',
'body' => 'Your content is live.',
]);