Laravel + Livewire + PostgreSQL
Production guidelines for Laravel 13 monoliths, Livewire reactive components, Eloquent ORM query discipline, and queued job workers.
- Formats
- 4 files
- AGENTS.md
- 38 lines
- CLAUDE.md
- 16 lines
- Languages
- PHP
- Updated
- Oct 2026
- Used by
- 3 projects
Writes .claude/skills/laravel-livewire-postgres/SKILL.md
$ curl -s --create-dirs -o .claude/skills/laravel-livewire-postgres/SKILL.md https://stackitfast.com/rules/laravel-livewire-postgres/SKILL.mdRule files
Works with Cursor · Claude Code · Windsurf · AGY
Architecture notes
Architecture Overview
Standardized production guidelines for Laravel 13, Livewire, and PostgreSQL — a server-rendered PHP monolith pattern that avoids a separate frontend build for most CRUD-heavy applications.
Verified Real-World Adoption
Coolify, a self-hosted PaaS for deploying applications and databases, is built on exactly this stack: Laravel + Livewire + Alpine.js + Tailwind CSS + PostgreSQL, run inside Docker.
Key Architectural Nuances
- N+1 Prevention as a First-Class Concern:
Model::preventLazyLoading()turns silent N+1 query degradation into a loud local exception, catching the single most common Eloquent performance bug before it reaches production. - Queues as the Default for Side Effects: Any external call (email, webhook, file processing) is expected to go through a queued Job rather than execute inline, keeping request/response cycles fast and retryable on failure.
Frequently asked questions
Does this AGENTS.md work with Cursor, Claude Code, and Windsurf?
Yes — AGENTS.md is the open, cross-tool standard read by Cursor, Claude Code, Windsurf, and 30+ other agents. A dedicated .mdc file is also included for Cursor's native .cursor/rules format.
Why Livewire instead of a separate React/Vue frontend?
Livewire lets a Laravel monolith ship reactive, dynamically-updating UI while keeping all state and logic in PHP on the server — no separate API layer, no client-server type duplication, and no second build pipeline. It trades some client-side interactivity ceiling for a much simpler architecture, which fits most CRUD-heavy SaaS and admin tools well.
Why does PHP/Laravel appear as its own stack instead of folded into the "Ruby / PHP" survey option?
Rails and Laravel solve the same class of problem (server-rendered monolith, batteries-included ORM, background job queue) but have distinct enough conventions -- Eloquent vs ActiveRecord, Livewire vs Hotwire, Artisan vs Rails generators -- that a single AGENTS.md covering both would blur the guidance. This rule is the Laravel-specific counterpart to the Rails + PostgreSQL + Redis rule.
Used in production
Explore all stacksNextcloud
Server internals (OC) are kept separate from a versioned public API (OCP) so that independently namespaced apps under apps/ can extend Nextcloud without depending on private implementation details, while database support is validated per-engine in CI.
Coolify
A Laravel + Livewire monolith that bundles its own buildpacks (Nixpacks, Railpack) and a self-hosted Soketi realtime server lets one application both serve the dashboard and build/deploy arbitrary user code on remote servers without depending on external SaaS.
Appwrite
A single PHP/Swoole codebase shares its API and worker processes so every product (Auth, Databases, Functions, Realtime) scales as copies of one image, while pluggable adapters keep PostgreSQL and Redis as defaults without hard-coding them.