https://github.com/ashishkumbhar01/supabase-php
Supabase client for PHP. Supabase for php.
https://github.com/ashishkumbhar01/supabase-php
php supabase supabase-client supabase-php supabase-realtime supabase-storage
Last synced: 4 months ago
JSON representation
Supabase client for PHP. Supabase for php.
- Host: GitHub
- URL: https://github.com/ashishkumbhar01/supabase-php
- Owner: Ashishkumbhar01
- License: mit
- Created: 2024-08-14T16:50:54.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-10T08:15:18.000Z (over 1 year ago)
- Last Synced: 2025-02-10T09:24:53.128Z (over 1 year ago)
- Topics: php, supabase, supabase-client, supabase-php, supabase-realtime, supabase-storage
- Language: PHP
- Homepage:
- Size: 181 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README






[](https://github.com/sponsors/Ashishkumbhar01)
Supabase client for PHP:
- Realtime database, Storage, Authentication and many more.
- When you creating your supabase table, make sure RLS (Row Level Security) option be [×] disable.
- If RLS are enable [✓] maybe you getting some error so you need to use `Auth class`.
Auth class coming soon.
### `Install`
* Install Supabase client for our project.
* Than we are require supabase-client by composer.
```bash
composer require supabase-php/supabase-client # letest
# OR Downloads old version
composer require supabase-php/supabase-client:"1.0.4"
```
### Config
Supabase client for PHP configuration with your php project/web Apps.
```php
use Supabase\Functions as Supabase;
// autoload the supabase class
require_once('vendor/autoload.php');
// config
$config = [
'url' => $_ENV['SB_URL'],
'apikey' => $_ENV['SB_APIKEY']
];
$client = new Supabase($config['url'], $config['apikey']);
```
if you did not have `.env` file so please create your `.env` file.
```bash
touch .env
```
if you create already your `.env` file then you will be derclare your enviroment variables names.
```bash
vi .env
```
```env
SB_URL=https://rurtighghurtuhouger.supabase.co
SB_API_KEY=utertu895tyut8trrvt8rtu8mutt84r548t894v98v5vtt6ut54uu85tu
```
### `getAllData()`
if you want to get all recorded data from your table when you saved the data then used `getAllData` function.
```php
$data = $client->getAllData('table name');
print_r($data);
```
### `getSingleData()`
if you need a specifics data from specifics columns then you used `getSingleData` function.
```php
$data = $client->getSingleData('table name', 'column name');
print_r($data);
```
### `postData()`
if you want to save your data to your table then used `postData` function.
```php
// posted data
$data = [
'name' => 'PHP',
'version' => '8.3'
];
$client->postData('table name', $data, 'id');
// 3rd option on_conflict
```
### `updateData()`
if you thinks something to be wrong or outdated so you will be changing that particular value from particular columns and also you updating all the data.
Then used `updateData` function.
```php
// updated data
$data = [
'name' => 'PHP',
'version' => '8.4'
];
$client->updateData('table name', 'id number', $data);
```
### `deleteData()`
if you want to Delete a specificed data from the table, then used `deleteData` function.
you needed the id number of table data.
```php
$client->deleteData('table name', 2 //id);
```
### `Pagination()`
```php
$client->pages('table name');
```
### `Filtering()`
```
$client->filter('table name', 1);
```
### `Matching()`
```php
$data = [
'name' => 'PHP',
'version' => '8.4'
];
$client->matchs('table name', $data);
```
### Authentication
* Auth Class coming soon.
### Storage
* storage class coming soon.
*