Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 2 min read How-to mediumAdept

Getting started with Laravel and Postgres

A new Laravel app can be connected to a Supabase-hosted Postgres database in a few steps: scaffold the project with Composer, install Laravel Breeze for built-in authentication, set DB_CONNECTION=pgsql and DATABASE_URL to the Supabase pooler connection string, then run migrations and start the dev server. One Supabase-specific tip is to change Laravel's search_path from the public schema to a dedicated schema such as 'laravel', because Supabase exposes public through its data API. Breeze uses Laravel's own auth rather than Supabase Auth, so only database resources are billed.

Assumes: PHP and ComposerLaravel basics

Related posts

  • Getting started with Ruby on Rails and Postgres on Supabase

    Supabase mediumAdept

    A Rails app can be wired to a Supabase-hosted Postgres database by scaffolding with `rails new -d=postgresql` and supplying the Supabase pooler connection URI through the `DATABASE_URL` environment variable. The walkthrough generates an Article scaffold, runs migrations, inserts and queries records from the Rails console, and routes the root path to the articles index. Deployment to Fly.io uses `fly launch` with Postgres provisioning set to none, the connection string stored as a Fly secret, and `fly deploy`.

  • Supabase Branching

    Supabase mediumAdept

    Supabase Branching gives each Git branch an isolated hosted Preview environment with its own Postgres database, Auth, Storage, Realtime, Edge Functions and APIs, plus separate credentials. A GitHub app runs migrations from ./supabase/migrations when a PR opens, applies new migration files incrementally on push, seeds from seed.sql, and runs the migrations against production on merge. It integrates with Vercel Preview deployments by auto-populating branch connection secrets. Early access is rolling out in batches to paid orgs, with copy-on-write snapshots, declarative config and automatic dashboard commits planned.

  • Supabase Local Dev: migrations, branching, and observability

    Supabase easyNovice

    Supabase's CLI gains a batch of Postgres local-development features: `supabase inspect db` with 19 diagnostic commands adapted from Heroku's pg-extras, `db dump` backups built on pg_dump, migration squashing and diffing via migra, pgTAP testing with `supabase test`, plpgsql_check linting, seeding, and TypeScript type generation that now detects foreign-key relationships. Local logs are viewable in the dashboard, and the CLI moves to a fortnightly stable-release cycle with a beta channel. Branching enters alpha: each GitHub pull request gets an isolated Firecracker-based preview environment that runs the repo's migrations and seed.sql, with migrations applied to production on merge. Production data cloning is deliberately deferred until copy-on-write with anonymization is judged safe.

  • Supabase CLI

    Supabase mediumAdept

    Supabase's new CLI runs the full Supabase stack locally via Docker Compose, using the same tooling as production, and walks through wiring it to a React app. For migrations, Supabase prefers schema diffing over hand-written migration scripts. After evaluating migra, dbdiff, pgdiff, apgdiff, pgquarrel and pgAdmin Schema Diff, it picked pgAdmin's because it tracks VIEW owner changes, which Row Level Security on views depends on, and it also handles domains. Since pgAdmin's diff was GUI-only, Supabase built a CLI mode for it and shipped it as a Docker image. A `supabase eject` command emits docker-compose, Kong and Postgres configs for self-hosting.

  • Supabase is now on Postgres 13.3

    Supabase easyNovice

    New Supabase projects now run Postgres 13.3 (up from 12.0), bringing native gen_random_uuid, parallel index vacuuming, incremental sorting and smaller B-tree indexes. Supabase Postgres versioning now tracks upstream major/minor versions, and Postgres is built from source so ARM Graviton 2 instances can use Large System Extensions (LSE) for faster atomics and locking, with pgbench comparisons on m6gd.8xlarge. The release also moves to Ubuntu 20.04, adds the pgRouting and wal2json extensions, configures fail2ban on ports 5432 and 6543 (10-minute ban after three failed attempts), and previews PgBouncer/PostgREST marketplace bundles.

The quest for software engineering knowledge.

Look:
Layout: