HTMX + Laravel
IntermediateWeb AppLaravel Blade templates enhanced with HTMX: PHP interactivity without writing JavaScript.
Published 27 September 2026
About HTMX + Laravel
HTMX + Laravel brings server-driven interactivity to Laravel's Blade templating system. HTMX lets Blade-rendered HTML trigger HTTP requests and replace sections of the page with the server response, giving the feel of a single-page app while keeping all logic in PHP Laravel controllers. PostgreSQL is the database, Tailwind CSS is an optional styling addition, and a cost-effective VPS is the typical host.
Laravel routing, Eloquent ORM, and Blade components are all fully preserved alongside HTMX. A table row with hx-delete and hx-target removes itself from the DOM when the Laravel controller confirms deletion, without a page reload or a custom JavaScript fetch. Search inputs with hx-get and hx-trigger="keyup delay:300ms" send requests as the user types and HTMX replaces the results container. Laravel returns a Blade partial; HTMX swaps it in.
This stack is the natural progression for Laravel developers who want more interactivity than full-page reloads provide, without adopting Livewire or building a separate Vue or React SPA. Affordable VPS hosting keeps costs low for PHP applications that do not need serverless scaling. The combination of Laravel's productivity and HTMX's minimal footprint is compelling for teams that live in PHP but want modern UX.
Key Features
- ✓HTMX partial updates swap Blade partial responses into the page without full reloads
- ✓Laravel controllers return either full Blade views or partial fragments based on HTMX request headers
- ✓Eloquent ORM with relationships, scopes, and migration history for PostgreSQL
- ✓Tailwind CSS utility classes work naturally with server-rendered Blade templates
- ✓Laravel auth, queues, events, and notifications remain fully available
- ✓Low-cost VPS hosting, significantly cheaper than PaaS platforms for PHP apps
When to Use HTMX + Laravel
- →Laravel apps that need more interactivity than Blade plus full-page reloads can provide
- →Teams that want to avoid Livewire or a React/Vue SPA without sacrificing UX
- →Admin panels and internal tools with inline editing, filters, and live search
- →Data entry workflows where partial validation feedback improves the experience
Pros
- Laravel developers add interactivity to existing Blade apps with minimal new concepts
- No JavaScript build pipeline: no npm, no webpack, no package.json in the PHP project
- Hetzner VPS is significantly cheaper than PaaS platforms for PHP workloads
- Server-side rendering keeps SEO intact, and HTMX pages are indexable without extra configuration
Cons
- Network round-trips on every HTMX interaction, so it's not suitable for real-time collaborative features
- Rich client-side interactions (drag-and-drop, canvas, complex animations) still require JavaScript
- A self-managed VPS requires server configuration, without the managed deploys of a PaaS platform
- HTMX and Livewire serve similar use cases, and teams sometimes struggle choosing between them
Database Options for HTMX + Laravel
The standard choice: a full PostgreSQL instance on a managed host or your own server, connected from Laravel via Eloquent, with complete control over configuration and extensions.
The other half of the classic LAMP-adjacent PHP stack: Eloquent talks to MySQL exactly the same way it talks to PostgreSQL, so this is a vendor choice, not an architecture change. Worth it if your host, team, or existing tooling is already MySQL-centric.
Laravel's Eloquent ORM and Query Builder support MariaDB through the same MySQL driver, and Laravel's own documentation lists MariaDB as a supported database alongside MySQL. Pick this over MySQL for MariaDB's fully open licensing, or when that's what your host defaults to.
These are highlighted picks. To see all the tools, check the Databases category.
Hosting Options for HTMX + Laravel
A self-hosted VPS running the whole Laravel + HTMX app yourself, at the price of managing deployment and updates. Entry-level instances start around €4-5/mo, the cheapest option here, though there's no bundled CDN.
A container-based platform where the whole Laravel + HTMX app deploys as a persistent service, a natural fit for PHP-FPM holding a live database connection pool. No free tier: the Hobby plan starts around $5/mo in usage credit, plus usage-based billing for CPU, memory, and network. Auto-deploys on push.
The same persistent-service model as Railway, with a genuinely free tier for small Laravel apps, built-in cron jobs, and its own CDN for static assets. Free-tier services spin down after inactivity; predictable always-on pricing starts around $7/mo.
Runs the Laravel app as a container close to users across multiple regions, useful if latency to a geographically spread user base matters more than raw cost. Billing is usage-based with only a small free allowance.
These are highlighted picks. To see all the tools, check the Hosting & Cloud category.
HTMX + Laravel Add-ons
Each addition below extends this stack with a capability the base stack works fine without. None are required: include the ones your product actually needs when building this stack, and skip the rest.
Authentication Add-ons
Add authentication when the app needs user accounts — sign-up, login, and data scoped to a specific user instead of a fully open app.
Laravel's official headless authentication backend: registration, email verification, password reset, and two-factor authentication out of the box, wired into Laravel's own Auth facade. The default here because it's what most Laravel projects reach for once they need more than the framework's bare guards and providers.
These are highlighted picks. To see all the tools, check the Authentication category.
CI/CD Add-ons
Add CI/CD when you want a dedicated pipeline for running tests, linting, or multi-stage builds before a deploy goes out. Many hosting platforms already redeploy automatically on every push on their own — a CI/CD tool adds the most value on top of that by gating the deploy on a passing test suite, and matters even more when the hosting choice does not auto-deploy at all, such as a self-hosted server.
Runs the test suite and triggers deployments on every push, directly from the same GitHub repo the code already lives in, with no separate CI service to configure.
These are highlighted picks. To see all the tools, check the CI/CD Pipelines category.
Containerization Add-ons
Add containerization when you want the app packaged the same way across local development, staging, and production, or need to deploy somewhere that isn't a managed serverless platform.
These are highlighted picks. To see all the tools, check the Containerization category.
Observability Add-ons
Add observability when you want to catch errors and performance regressions in production before users have to report them.
Error tracking and performance monitoring with a dedicated sentry-laravel SDK, covering both HTTP requests and queued jobs. Open-source with a self-hosted path, alongside its own managed cloud.
A broader observability platform covering APM, infrastructure metrics, and log management in one dashboard, useful once a team is already running other services worth monitoring alongside this app. Managed-only, with pricing that scales by host and usage rather than Sentry's per-error volume.
These are highlighted picks. To see all the tools, check the Infrastructure & APM category.
Email Add-ons
Add email when the app needs to send account verification, password reset, or notification messages.
A transactional email API for account verification, password resets, and notification emails, sent via Resend's official Laravel package, which plugs into Laravel's own Mail facade, with a free tier for getting started.
The established high-volume choice, with dedicated IP addresses and deliverability tooling for apps sending at serious scale. No permanent free plan (a 60-day trial, then paid tiers), so it earns its slot when volume and deliverability matter more than upfront cost.
Payments Add-ons
Add payments when the product is ready to charge for subscriptions or one-time purchases.
Adds subscription billing, one-time checkout, and invoicing via Stripe's hosted Checkout or embedded Elements, with Laravel handling webhook verification and API calls server-side. The stack works fully without it; add this once the product is ready to charge for something.
Styling Add-ons
Add styling when you want a component or utility-class system to build the UI faster than hand-writing CSS from scratch.
A utility-class CSS framework: styles are composed directly in markup via class names instead of writing separate stylesheet files. The default styling choice bundled by most modern framework CLIs (create-next-app, create-vue, the SvelteKit and Astro starters all offer it), and the base layer shadcn/ui components are built on when that's loaded into the catalog in the future.
These are highlighted picks. To see all the tools, check the CSS Frameworks category.
Interactivity Add-ons
Add client-side interactivity when you want local UI state — toggles, modals, dropdowns, tabs — without a full JS framework or an extra server round trip.
Alpine.js is the client-side half of Laravel's own official TALL stack (Tailwind, Alpine, Laravel, Livewire) and ships by default in the Breeze and Jetstream starter kits, so most Laravel + HTMX projects already have it a composer create-project away. It handles local UI state (toggles, modals, dropdowns) that does not need a server round trip, leaving HTMX free to handle the parts that do.
These are highlighted picks. To see all the tools, check the HTML-first Frameworks category.
Analytics Add-ons
Add analytics when you want to measure traffic, track visitor behavior, or understand how people actually use the product.
An all-in-one product analytics platform: event tracking, session replay, feature flags, and A/B testing in one SDK. The richest feature set if you want more than pageviews.
The industry-standard, free analytics platform, with native Google Ads and Search Console integration. Requires a cookie consent banner in most jurisdictions (GDPR/CCPA), and all data lives on Google's infrastructure, the tradeoff the other three picks were built to avoid.
A lightweight, privacy-first analytics tool with no cookie banner required. A good fit for simple traffic metrics without PostHog's broader feature surface.
These are highlighted picks. To see all the tools, check the Web & Product Analytics category.
Frequently Asked Questions about HTMX + Laravel
How does this compare to Laravel Starter (without HTMX)?
Same Laravel core; HTMX adds partial-page swaps for specific interactions without a JS framework or build step. Add it once full-page reloads start feeling slow for common interactions; skip it for a mostly-static site.
How does this compare to HTMX + Django, HTMX + FastAPI, or HTMX + Rails?
All four pair HTMX with a different backend. Laravel brings Eloquent and Blade; Django brings a built-in ORM and admin panel; FastAPI brings async performance; Rails brings ActiveRecord and its own Turbo/Hotwire alternative. HTMX itself works the same way on all four, so pick based on which backend fits the rest of the project.
Should I use Laravel Fortify or Auth0?
Laravel Fortify is the ecosystem-standard choice: registration, email verification, password reset, and two-factor authentication out of the box, self-hosted and free. Auth0 is worth it instead if you'd rather not run the auth logic yourself, or need enterprise features like SSO that Fortify doesn't cover.
What's the cheapest way to run this stack?
Self-hosted PostgreSQL and skipping the paid addition tools cost nothing beyond hosting. Every hosting option here (Railway, Render, Hetzner, Fly.io) charges from day one for an always-on process, so expect at least about $5/mo once you're past local development.
Stacks Related to HTMX + Laravel
HTMX + Go (Gin)
ProjectGin (Go) serving HTMX-enhanced templates: server-driven UI at Go's native performance.
Laravel Starter
ProjectPHP Laravel with Eloquent ORM and Blade templating.
HTMX + Rails
ProjectRails views with HTMX: server-driven interactivity as an alternative or complement to Turbo.
HTMX + Django
ProjectDjango views with HTMX for dynamic UIs without a JS framework.
Scores
Popularity2/5
Laravel is well-established, but pairing it with HTMX specifically is a smaller, if fast-growing, pattern compared to a JS framework frontend — genuinely capable for the "server-rendered but interactive" niche, not yet a mainstream default.
Learning Curve3/5
Laravel's conventions (Eloquent, Blade, routing) are well-documented and approachable, and HTMX adds only a handful of HTML attributes rather than a new templating language. The adjustment is returning HTML fragments from Laravel controllers instead of full pages or JSON.
Flexibility3/5
Laravel's ORM and Blade templates are opinionated about project structure, and HTMX itself just swaps HTML fragments without adding flexibility on top. Consistent and productive, not a highly configurable setup.
Performance4/5
HTMX's partial-page swaps avoid a full page reload for most interactions, and Laravel's Blade compiles to plain PHP for fast rendering. Not a 5 only because every interaction is still a server round-trip.
Portability3/5
Laravel and HTMX are both open-source with no vendor lock-in, portable to any PHP-capable host. The main migration cost is Laravel's own Eloquent/Blade conventions — HTMX itself adds very little coupling since it's just HTML attributes.
Tools in the HTMX + Laravel Stack
HTMX + Laravel Pricing
Laravel, HTMX, Tailwind CSS, PHP and PostgreSQL are all open-source and free. HTMX adds interactivity without a separate JavaScript build or frontend host, so you only pay for one app server and a database: about $5–20/mo on Railway, Render, Fly.io or Hetzner, with managed Postgres from roughly $6–15/mo if you don't self-host.
Laravel, HTMX, Tailwind CSS, PHP and PostgreSQL are free.
A single app server on Railway, Render, Fly.io or Hetzner; free tiers for testing.
Self-host for free, or use managed Postgres from about $6–15/mo.