PHPackages                             rafaelwendel/phpsupabase - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rafaelwendel/phpsupabase

ActiveLibrary[API Development](/categories/api)

rafaelwendel/phpsupabase
========================

PHPSupabase is a library written in php language, which allows you to use the resources of a project created in Supabase (https://supabase.io), through integration with its Rest API.

0.0.11(6mo ago)22592.6k—2.6%24[7 issues](https://github.com/rafaelwendel/phpsupabase/issues)[1 PRs](https://github.com/rafaelwendel/phpsupabase/pulls)1MITPHP

Since Dec 2Pushed 6mo ago11 watchersCompare

[ Source](https://github.com/rafaelwendel/phpsupabase)[ Packagist](https://packagist.org/packages/rafaelwendel/phpsupabase)[ Docs](https://github.com/rafaelwendel/phpsupabase)[ RSS](/packages/rafaelwendel-phpsupabase/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (1)

PHPSupabase
===========

[](#phpsupabase)

PHPSupabase is a library written in php language, which allows you to use the resources of a project created in Supabase ([supabase.io](https://supabase.io)), through integration with its Rest API.

Content
-------

[](#content)

- [About Supabase](#about-supabase)
- [PHPSupabase Features](#phpsupabase-features)
- [Instalation &amp; Loading](#instalation-&-features)
- [How to use](#how-to-use)
    - [Auth Class](#auth-class)
        - [Create a new user with email and password](#create-a-new-user-with-email-and-password)
        - [Sign in with email and password](#sign-in-with-email-and-password)
        - [Get the data of the logged in user](#get-the-data-of-the-logged-in-user)
        - [Update user data](#update-user-data)
    - [Database class](#database-class)
        - [Insert data](#insert-data)
        - [Update data](#update-data)
        - [Delete data](#delete-data)
        - [Fetch data](#fetch-data)
        - [Comparison operators](#comparison-operators)
    - [QueryBuilder class](#querybuilder-class)

About Supabase
--------------

[](#about-supabase)

Supabase is "The Open Source Firebase Alternative". Through it, is possible to create a backend in less than 2 minutes. Start your project with a Postgres Database, Authentication, instant APIs, realtime subscriptions and Storage.

PHPSupabase Features
--------------------

[](#phpsupabase-features)

- Create and manage users of a Supabase project
- Manage user authentication (with email/password, magic links, among others)
- Insert, Update, Delete and Fetch data in Postgres Database (by Supabase project Rest API)
- A QueryBuilder class to filter project data in uncomplicated way

Instalation &amp; loading
-------------------------

[](#instalation--loading)

PHPSupabase is available on [Packagist](https://packagist.org/packages/rafaelwendel/phpsupabase), and instalation via [Composer](https://getcomposer.org) is the recommended way to install it. Add the follow line to your `composer.json` file:

```
"rafaelwendel/phpsupabase" : "^0.0.1"
```

or run

```
composer require rafaelwendel/phpsupabase
```

How to use
----------

[](#how-to-use)

To use the PHPSupabse library you must have an account and a project created in the Supabase panel. In the project settings (API section), you should note down your project's `API key` and `URL`. (NOTE: Basically we have 2 suffixes to use with the url: `/rest/v1` &amp; `/auth/v1`, but since version `0.0.5` the definition of one of these suffixes is optional)

To start, let's instantiate the `Service()` class. We must pass the `API key` and `url` in the constructor

```
