PHP code example of saeedvir / supabase

1. Go to this page and download the library: Download saeedvir/supabase 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/ */

    

saeedvir / supabase example snippets

 artisan config:clear

use Saeedvir\Supabase\Facades\Supabase;

// Database operations
$users = Supabase::db()->select('users', '*', ['active' => true]);

// Auth operations
$result = Supabase::auth()->signIn('[email protected]', 'password');

// Storage operations
$result = Supabase::storage()->upload('avatars', 'user-avatar.png', '/path/to/local/file.png');

// Realtime operations
$url = Supabase::realtime()->channelUrl('public', 'users');

use Saeedvir\Supabase\Services\SupabaseService;

$supabase = new SupabaseService();

// Database operations
$users = $supabase->db->select('users', '*', ['active' => true]);

// Auth operations
$result = $supabase->auth->signIn('[email protected]', 'password');
bash
php artisan vendor:publish --provider="Saeedvir\Supabase\SupabaseServiceProvider" --tag="supabase-config"