Everything on Laravel.
92 articles tagged Laravel, sorted newest first.
Provider Fallback and Failover with the Laravel AI SDK
A single LLM provider is a single point of failure. Here's how to fail over to a backup provider with the Laravel AI SDK without rewriting a line of prompt code.
Live Form Validation in Laravel with Precognition (Alpine + Blade)
Validate forms as the user types using your real backend rules — no rule duplication, no full submit. Here's the full Precognition + Alpine wiring.
PHP 8.4 Lazy Objects: Defer Expensive Initialization in Laravel
You inject a heavy service into a controller, the container builds it on every request, and half your routes never touch it. PHP 8.4 lazy objects let you defer that cost until the object is actually used.
Tailwind v4 @utility — Define Custom Utilities in CSS, Not JavaScript
Your v3 addUtilities plugin is dead. Here's how the Tailwind v4 @utility directive replaces it — static, functional, and value-typed utilities, all in resources/css/app.css.
GitHub Actions + Pest Sharding — Cut Laravel CI from 12 Minutes to 3
Split your Pest suite across four GitHub Actions matrix jobs, balance them by real execution time, and gate merges on a single status check.
Laravel Octane RoadRunner in Production — Tuning max_jobs, Worker Memory, and Supervisor
The four knobs that decide whether Octane on RoadRunner is a 5x performance win or a 3am pager: worker recycling, memory caps, worker count, and a Supervisor config that survives deploys.
Laravel Job Middleware — Rate-Limit and Back Off Queued Jobs at the Job Level
Stop sprinkling RateLimiter::attempt() inside your job classes. Laravel job middleware wraps handle() with rate limits, back-off, and circuit breakers — here's the full pattern.
Laravel 13 PreventRequestForgery: Origin-Aware CSRF Protection in 5 Minutes
Laravel 13 renames VerifyCsrfToken to PreventRequestForgery and adds a Sec-Fetch-Site origin check on top of the token. Here's what changed, how to configure it, and the upgrade traps.
Laravel Reverb in Production — Horizontal Scaling, Presence Channels, and Load Balancing
Single-node Reverb is a fine starting point, but a real cluster needs Redis pub/sub, sticky sessions, supervised processes, the right health check, and connection monitoring. Here is the full playbook.
Laravel AI SDK Structured Output — JSON Schema Enforcement for LLM Responses
Stop parsing markdown fences and stripping prose out of LLM replies. The Laravel AI SDK ships a HasStructuredOutput contract that forces the model to return JSON matching the schema you describe in PHP — and the same agent works across every supported provider.
PestStan — Type-Safe Pest 4 Tests With PHPStan Generics in a Laravel App
PestStan teaches PHPStan about Pest's globals — generic expect() types, proper $this binding, and rules that catch broken assertions before the test even runs.
Livewire 4 #[Computed(persist: true)] — Cache Heavy Queries Across Requests
Livewire 4's #[Computed(persist: true)] flag turns a memoised method into a Laravel-cached value that survives every hydration cycle. Here's the gotchas.
Filament v4 Global Search: Custom HTML Result Titles and Inline Actions
Most Filament panels ship with the default plain-text global search and stop there. Here's how to render badges, attach Quick Edit actions, and scope results per tenant: all from four methods on the resource.
Filament v4 Nested Resources: Editing Child Models in Parent Context Without RelationManagers
How to scaffold a Filament v4 nested resource that edits child models inside the parent's URL: with scoped queries, pre-filled foreign keys, and policies that hide forbidden actions.
Laravel Scout + Typesense: A Production Guide to Typo-Tolerant, Faceted, and Vector Search
Devs reach for the Scout database driver, watch a LIKE query crawl on 200k rows, and realise they need a real engine. Here's the full Typesense path: async indexing, facets, hybrid vector search, and a Pest test suite.
Pest 4 Snapshot Testing for Laravel API Responses: Catch Accidental Schema Drift
Pest 4 has snapshot testing built in. One expectation locks down the shape of your JSON responses so renamed keys and disappearing fields stop slipping into production unnoticed.
Stream Prism AI Responses Token-by-Token into Livewire with wire:stream
A ChatGPT-style chat UI in Laravel without writing a line of JavaScript, without WebSockets, without a separate Node process. Prism streams the tokens, Livewire's wire:stream paints them, you write the bubble.
Filament v4 Import and Export Actions: Built-in Bulk CSV Without a Plugin
A walkthrough of Filament v4's first-party ImportAction and ExportAction: Importer columns, the queued batch, failed-rows CSV, and the dialect tweaks Excel needs.
Flux UI Table in Livewire 4: The Complete Guide to Server-Driven Pagination, Sorting, and Filtering
A 90-minute walkthrough that turns flux:table into a real data table: sortable headers, debounced search, multi-select filters, bulk-delete, inline-edit cells, URL state, named paginators, and a Pest 4 test suite that proves the lot.
Livewire 4 Direct-to-S3 Temporary File Uploads: Stop Funnelling Bytes Through PHP
Default Livewire uploads route a 500MB MP4 through your PHP process. Here's the four-line config flip that sends bytes straight to S3: plus the CORS rule that always trips you up.
Livewire 4 Form Objects with #[Validate]: Stop Bloating Your Components
A twelve-property component with its own $rules array, messages() method and resetForm() helper isn't a component anymore: it's a controller. Form Objects fix that.
Livewire 4 wire:navigate: Get an SPA Feel Without Building a SPA
One attribute on your anchor tags turns a server-rendered Laravel app into something that feels like Next.js. Here's the prefetch tuning, @persist, and lifecycle hooks most tutorials miss.
Livewire 4 and Alpine.js: Share State with $wire and @entangle (Without Killing Your Server)
Two state systems in one component. Here's when to keep state in Alpine, when to entangle, and the wire:model.live trap that quietly fires ten requests a second.
Drag-and-Drop Reordering with Livewire 4 wire:sort
Livewire 4 ships drag-and-drop sorting natively. Here's the exact directive set, the handler signature, and a Kanban variant: minus the dead livewire/sortable package.
Trace Every LLM Call: Langfuse Observability for Prism in Laravel
Prism gives you the LLM API; Langfuse gives you the receipts. Wire them together with one env var and trace every prompt, token, and tool call in twenty minutes.
Upgrade a Laravel App from Tailwind v3 to v4 with the Official Upgrade Tool
Tailwind v4 is a rewrite: Rust engine, no tailwind.config.js, renamed gradient and shadow scales. Here is the exact upgrade path I took on a production Laravel app, with the gotchas the upgrade tool will not catch for you.
Tailwind CSS v4 Dark Mode in Laravel: CSS-First with @custom-variant
Tailwind v4 killed tailwind.config.js. This walkthrough wires class-based dark mode end-to-end: @custom-variant in app.css, @theme tokens, an Alpine toggle, and a tiny inline script that kills the white flash on first paint.
Custom Filament v4 Actions with Confirmation Modals and Notifications
A walkthrough of building a Filament v4 Action that opens a confirmation modal, collects form input, runs the side-effect, and fires the right notification: without dropping into raw Livewire.
Filament v4 Many-to-Many Relation Managers: Pivot Fields, Attach, and Detach
How to surface pivot data in a Filament v4 relation manager: withPivot, AttachAction with form fields, scoped record selects, and a safe detach story.
Build a Custom Form Field in Filament v4: From make:filament-form-field to Production
A working walkthrough of building a custom Filament v4 form field: from the new artisan generator through Alpine state, validation, reactive callbacks, and a Pest test.
Stripe Identity Verification in Laravel: KYC Without a Compliance Vendor
Stripe Identity is right there in the dashboard you already use, costs $1.50 per US check, and rides on the same session + webhook pattern as Checkout.
Laravel Octane + FrankenPHP: Production Deployment Without Surprises
FrankenPHP turns Octane from a benchmark trick into a production runtime. Here's the actual checklist for shipping it behind Nginx without a 3am incident.
Laravel 13 Reverb Database Driver: WebSockets Without Redis
The Reverb database scaling driver lets you run real-time WebSockets on a single Laravel box without standing up Redis. Here's the production setup.
Laravel Queue Chains vs Batches: When to Pick Which
Bus::chain and Bus::batch solve different queue problems. Here's the decision framework and the combinations I reach for in production.
Production AI Agents in Laravel: Reliable Loops with Prism and Laravel Workflow
A production-grade playbook for Laravel AI agents: verifier loops, idempotent tools, durable workflow state, Langfuse tracing, and evaluating agent quality in CI.
Pest 4 Browser Testing with Playwright: A Dusk Replacement That Actually Sticks
Pest 4 ships a first-party browser plugin powered by Playwright. Auto-waits, parallel runs, and time-balanced shards turn a 12-minute Dusk suite into a 90-second CI job.
Stripe Flexible Billing Mode in Laravel Cashier: What Changed and How to Migrate
Stripe quietly made flexible billing mode the default for new subscriptions. Here's what flexible unlocks, where Cashier breaks today, and the migration path.
Laravel 13 whereVectorSimilarTo(): Native Semantic Search in the Query Builder
Laravel 13's whereVectorSimilarTo() turns the query builder into a vector store. Plain strings in, ranked results out: no manual embedding pipeline.
PHP Custom Attributes in Practice: Beyond Laravel's Built-ins
Laravel 13 ships dozens of built-in PHP attributes, but the docs are quiet on building your own. Here are the patterns I use in production for validation, auth, and auto-discovery.
Rector PHP: Automate Laravel Upgrade Refactors
Stop hand-editing hundreds of files when bumping PHP or Laravel versions. Here's how to wire Rector into a Laravel project, run it safely, and write a custom rule for the patterns specific to your codebase.
The Complete Guide to Laravel 13 Multi-Tenancy with Teams
Laravel 13 brings team-based multi-tenancy back into the official starter kits with URL-based context that fixes the old session-based problems. This guide walks through the full lifecycle: scaffolding teams, scoping every query, handling invitations, isolating queued jobs, and choosing between shared-database and database-per-tenant: with copy-paste-runnable code at every step.
Multi-Currency Checkout with Stripe and Laravel Cashier
Going international means charging in your customer's currency without re-architecting Cashier. Here's the production setup I use: per-currency prices, locale detection, and webhook handling that doesn't lie about amounts.
Laravel Health Checks for Kubernetes Readiness and Liveness Probes
Laravel's /up route only proves the framework booted. Here's how to build readiness and liveness endpoints Kubernetes can actually trust: covering the database, Redis, queue, and disk.
Livewire 4 Islands: Lazy-Load Expensive Components
Livewire 4 islands let you isolate expensive sections so they load independently without blocking the rest of your page. Here's how to use them.
Laravel Pennant Feature Flags in Practice
Laravel Pennant gives you first-party feature flags without an external service. Here's how to use it for gradual rollouts, middleware gates, and reliable testing.
Handling Stripe Disputes and Chargebacks in Laravel
Chargebacks happen to every SaaS eventually. Here's how to listen for Stripe dispute webhooks, auto-collect evidence, and submit it programmatically before the response window closes.
Stripe Connect Express Onboarding in Laravel
Build marketplace-style payments in Laravel using Stripe Connect Express: onboard sellers via Stripe's hosted flow, then route funds and take your platform fee.
Laravel Telescope vs Debugbar vs Pulse: Which Monitoring Tool When
Laravel ships three monitoring tools and most teams install all three without knowing which does what. Here's when to reach for each one.
Stripe Pricing Tables with Laravel: Embed Checkout Without Custom UI
Stripe's Pricing Table handles your plan cards, billing period toggle, and promo codes: no custom UI needed. Here's how to embed it in Laravel and wire up customer tracking.
GitHub Actions Matrix Testing for Laravel: PHP × Database Combos
Stop testing against one PHP version and one database. Here's the copy-paste GitHub Actions matrix workflow that covers PHP 8.2–8.4 against MySQL, PostgreSQL, and SQLite in one go.
Building a RAG Pipeline with Laravel AI SDK and pgvector
Build a complete retrieval-augmented generation pipeline in Laravel: from embedding documents and storing vectors in pgvector to generating grounded answers with the AI SDK.
Laravel Boost MCP: Let AI Agents Understand Your Codebase
AI coding assistants stumble on Laravel's magic methods and facades. Boost is a local MCP server that gives them structured context so they stop guessing.
PHPStan Level 10 in Laravel: Fix the 5 Most Common Errors
Bumped Larastan to level 10 and got 300 new errors? Here are the five patterns you'll see again and again: and the exact fix for each.
The Complete Guide to Laravel 13 JSON:API Resources
Laravel 13 ships first-party JSON:API resources that handle spec-compliant serialization, relationships, sparse fieldsets, and compound documents out of the box. This guide walks through building a complete API using the new JsonApiResource class: from first resource to production-hardened endpoints.
Laravel MCP Server: Expose Your App to AI Clients in 15 Minutes
The laravel/mcp package turns your Laravel app into an MCP server with a few artisan commands: no Node, no Python, just familiar middleware and routing.
Laravel 13 PHP Attributes: Cleaner Models, Jobs, and Commands
Laravel 13 ships opt-in PHP attribute syntax across 36+ framework locations. Here's what changed for models, jobs, and Artisan commands: with zero migration required.
Ditching Passwords: Setting Up Passkeys in Laravel 13
Passkeys are phishing-resistant, require no remembered secrets, and the browser handles the crypto. Here's how to add them to a Laravel 13 app in under an hour.
Handling Stripe Subscription Lifecycle Events in Laravel: Beyond Webhook Verification
Signature verification is step one. Here's what to do with the six Stripe subscription lifecycle events that actually matter: what Cashier handles for you and how to write the rest.
Dockerising Your Laravel App for Kubernetes: From Dockerfile to Running Pod
Take a Laravel app from Docker Compose to a running Kubernetes pod: covering the production Dockerfile, Nginx+PHP-FPM setup, and the K8s manifests you actually need.
Laravel Prism Tool Calling: Build AI Agents That Actually Do Things
Prism's tool calling turns a text-generating LLM into an agent that can actually *do* things: query your database, hit an external API, or dispatch a queued job.
Clean Up Your Jobs Config With Laravel 13's Queue::route()
Laravel 13 adds Queue::route(): a single place in your service provider to declare which queue and connection every job class uses. Here's how it works.
Upgrading From Laravel 12 to Laravel 13: The Practical Guide
The Laravel 13 upgrade is mostly painless: but three config areas will silently change how your app behaves if you skip them. Here's what actually changed and what's worth adopting.
The Complete Guide to the Laravel AI SDK in Laravel 13
Laravel 13 ships a first-party AI SDK that replaces the patchwork of vendor SDKs and community packages. Here's how to use every capability: agents, streaming, structured output, tools, embeddings and RAG: in one working project.
Getting Started With Laravel Prism: Add AI to Any Laravel App in Minutes
Prism gives you a provider-agnostic fluent interface for OpenAI, Anthropic, Ollama, and more inside any Laravel app. Here's how to go from zero to your first AI response.
Real-Time Notifications with Laravel Reverb and Echo
Reverb is Laravel's free, first-party WebSocket server. Here's how to go from zero to live browser notifications: private channels, Echo, and an Alpine.js toast: without touching Pusher.
Laravel Vapor vs Laravel Forge in 2026: Which Deployment Platform Should You Choose?
Both are first-party Laravel deployment tools. They solve completely different problems. Here's the decision framework I use.
Stop Laravel Queue Workers from Leaking Memory with --max-jobs and --max-time
Laravel queue workers are long-running daemons: and daemons drift. Here's how to configure them to self-restart before they start misbehaving.
Building an Automated Bug-Fixing Pipeline with Claude Cowork
A Claude Cowork scheduled task that reads Sentry errors, triages them via Linear, implements fixes in your Laravel codebase, and opens a GitHub PR: without you lifting a finger until review.
Stripe Checkout sessions in Laravel: without Cashier
Laravel Cashier is excellent for subscriptions, but one-time payments don't need that overhead. Here's how to wire up Stripe Checkout directly with the PHP SDK.
Optimising Laravel Docker images with multi-stage builds
A single-stage Dockerfile for Laravel ends up with 800 MB+ images full of build tools you don't need in production. Multi-stage builds fix that: here's how.
Fine-grained rate limiting on Laravel API routes
Slapping throttle:60,1 on every route treats your free-tier users and enterprise customers identically. Here's how to do it properly with named rate limiters.
Replacing String Constants with PHP Backed Enums in Laravel Models
String constants like STATUS_PENDING are typo-prone, unautocompleted, and impossible to enumerate exhaustively. PHP backed enums fix all of that: and Laravel has native support throughout.
PHP Readonly Classes as Value Objects in Laravel
Primitive obsession is one of those code smells that's easy to ignore: until you're debugging which integer is pounds and which is pence. PHP readonly classes fix that cleanly.
Processing large CSV files with Laravel's lazy collections
Loading a 100k-row CSV with `collect()` will blow your memory limit. Laravel's `LazyCollection` gives you the full Collection API backed by PHP generators: here's how to use it.
Adding a Stripe Customer Portal to your Laravel app with Cashier
Cashier's `redirectToBillingPortal()` gives your users a full subscription management UI: plan changes, cancellations, invoice downloads: in a single redirect. Here's how to wire it up.
Building custom Laravel Pulse recorders to track your own metrics
Pulse ships with solid built-in recorders. Here's how to extend it with your own: tracking the domain events that actually matter in your app.
Scaling Laravel queues in production: Horizon, Redis, and multi-server workers
Queue tutorials stop at dispatch and queue:work. Here is everything else: the architecture, Horizon configuration, failure handling, and multi-server scaling that keeps production queues healthy under real traffic.
Monitoring Laravel queues in production with Horizon
Most teams install Horizon and leave it at its defaults. Here's the production configuration that actually gives you visibility into your queues.
Upgrading from Livewire 3 to Livewire 4: A Practical Migration Guide
Livewire 4 shipped in early 2026 with SFCs, smarter wire:model, and a leaner Volt story. Here's how to upgrade a real app without surprises.
Usage-based billing with Stripe Meters and Laravel Cashier
Stripe Meters replace the old metered subscription records. Here's how to wire them up with Laravel Cashier to charge customers per API call, token, or any countable unit.
Enforcing Laravel architecture rules with Pest's arch() helper
Pest's arch() helper lets you write rules that enforce your app's structure at test time: no more accidentally importing Eloquent into a controller.
Verifying Stripe webhook signatures in Laravel without Cashier
You don't need Laravel Cashier to verify Stripe webhook signatures. Here's the minimal setup using the Stripe PHP SDK directly in a controller.
Zero-Downtime Laravel Deployments with GitHub Actions and Forge
Stop manually triggering Forge deploys. Here's how to wire GitHub Actions to Forge's deploy webhook so every push to main ships automatically: without downtime.
Fire HTTP requests after your response with Laravel 12's batch defer
Laravel 12.32 adds defer() to Http::batch(): a clean way to fire outbound HTTP calls after your response is sent, no queue worker required.
The Complete Laravel Developer Toolchain for 2026
Stop spending days configuring tools. Here is every tool in my Laravel stack for 2026, why I chose each one, and exactly how to set it up.
Running Laravel Pint Automatically with Git Pre-Commit Hooks
CI failing because someone forgot to run Pint again. Here's how to wire up a Git pre-commit hook so it never slips through.
PHP 8.4 Property Hooks in Laravel Models
PHP 8.4 property hooks are a tidy language-level alternative to getters and setters: but before you reach for them in your Eloquent models, there's a catch worth understanding.
Implementing Stripe trials for memberships: patterns and best practices
How to add trials to membership subscriptions using Stripe and Laravel Cashier, with patterns for free-until, trial_months, and safe webhook handling.
Stop Wasting Monitoring Quota: Block Malicious 404s with NGINX
Malicious bots were burning through my Laravel Nightwatch quota by hitting fake routes like /wp-login.php and /.env. Inspired by Michael Dyrynda’s approach using Cloudflare WAF, I built a portable NGINX blocklist that stops these 404s before they reach Laravel: no proxy required.
Streamlining Laravel Developer Onboarding with a Makefile and Herd Pro
Speed up Laravel onboarding with a powerful Makefile. Automate Herd Pro setup, install dependencies, and seed databases for a consistent, one-command setup experience.
A Developer’s Personal Site in 2025: What I Actually Use
Rebuilding my personal site from scratch using Laravel 12, Sushi, Folio, and Spatie packages: no CMS, no clutter, just a clean, fast dev blog.
Blazing-Fast Blogs with Laravel, Markdown, and Sushi
Why I chose Markdown and Sushi to power my Laravel blog: a simple, fast, and elegant alternative to heavier CMS setups.