Skip to content

Commit ba601e2

Browse files
Supabase clinet for php.
1 parent 7c02fa6 commit ba601e2

File tree

6 files changed

+379
-3874
lines changed

6 files changed

+379
-3874
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,39 @@
1111
Supabase client for PHP:
1212
- Realtime database, Storage, Authentication and many more.
1313
- When you creating your supabase table, make sure RLS (Row Level Security) option be [×] disable.
14-
- If RLS are enable [] maybe you getting some error so you need to use `Auth class`.
15-
Auth class coming soon.
14+
- If RLS are enable [] maybe you getting some errors.
15+
16+
17+
<details>
18+
<summary><h3> ⚠️ Warning </h3>
19+
</summary>
20+
<p><b><i>
21+
if you push the code to production while Row-Level Security (RLS) is disabled,
22+
it can pose a security threat to your application. To secure your app, please enable Row-Level Security.
23+
Otherwise, write an Object-Oriented PDO connection with PostgreSQL.
24+
</i>
25+
</b>
26+
</p>
27+
28+
### Env config code:
29+
```env
30+
HOST=aws-o-ap-south-pool.supabase.com
31+
PORT=6543
32+
USERNAME=postgres.grufgrcytvrh
33+
PASSWORD=[Your Password]
34+
DATABASE=postgres
35+
```
36+
</details>
37+
38+
1639

1740
### `Install`
1841
* Install Supabase client for our project.
1942
* Than we are require supabase-client by composer.
2043

2144
```bash
45+
composer require supabase-php/supabase-client # letest
46+
# OR Downloads old version
2247
composer require supabase-php/supabase-client:"1.0.4"
2348
```
2449

@@ -82,7 +107,8 @@ $data = [
82107
'version' => '8.3'
83108
];
84109

85-
$client->postData('table name', $data);
110+
$client->postData('table name', $data, 'id');
111+
// 3rd option on_conflict
86112
```
87113

88114
### `updateData()`

composer.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
{
2-
"name": "supabase-php/supabase-client",
3-
"description": "Supabase client for PHP",
4-
"keywords": ["supabase","supabase-php","supabase-client"],
5-
"version": "1.0.6",
2+
"$schema": "https://getcomposer.org/schem a.json",
3+
"name": "supabase-php/supabase-client",
4+
"description": "Supabase for PHP client.",
5+
"keywords": ["supabase","supabase-php","supabase-client"],
66
"type": "library",
77
"require": {
8-
"php": "^8.1"
9-
},
10-
"require-dev": {
11-
"vlucas/phpdotenv": "^5.6",
8+
"php": "^8.2",
129
"guzzlehttp/guzzle": "^7.9",
13-
"pestphp/pest": "^3.7",
14-
"phpstan/phpstan": "^2.1"
10+
"vlucas/phpdotenv": "^5.6"
1511
},
1612
"license": "MIT",
1713
"autoload": {
@@ -47,5 +43,8 @@
4743
"allow-plugins": {
4844
"pestphp/pest-plugin": true
4945
}
50-
}
46+
},
47+
"require-dev": {
48+
"phpstan/phpstan": "^2.1"
49+
}
5150
}

0 commit comments

Comments
 (0)