Articles › Laravel
TAG ARCHIVE

Everything on Laravel.

196 articles tagged Laravel, sorted newest first.

php

PHP 8.6's clamp(): Delete Your min(max()) Sandwiches

Every Laravel codebase has a min(max($perPage, 1), 100) somewhere, and at least one of them has the bounds backwards. PHP 8.6 gives you a function that can't be written wrong.

7 min read →
laravel

Scale Laravel Queue Workers to Zero and Back with KEDA

A worker blocked on Redis uses no CPU, so the HPA never scales it. Here is the KEDA ScaledObject that scales on queue depth instead — including scale-to-zero and the shutdown config that stops Kubernetes killing jobs.

11 min read →
laravel

A Laravel Validation Rule That Scores Spam and Toxicity with Jev

Honeypots stop bots, not humans dropping promotional links. Here's a Laravel validation rule that sends the submission to Jev, reads the score and the confidence, and fails open when the API is unreachable.

9 min read →
php

Upgrading a Laravel App to PHP 8.6: Deprecations, Session Defaults and a CI Checklist

PHP 8.6 lands on 19 November 2026. Here's the ordered checklist I run on Laravel apps — CI first, deprecations second, production runtime last.

9 min read →
laravel

Check Your LLM's Homework: Verifying Laravel AI SDK Output with Jev

A second LLM grading the first one is slow, expensive and wrong in the same places. Here's how I verify Laravel AI SDK answers with Jev instead.

10 min read →
php

PHP 8.6's Time\Duration: No More Guessing Whether That Timeout Is Seconds or Milliseconds

PHP 8.6 ships Time\Duration, a nanosecond-precision value object for stopwatch time. Here's the whole API, where it beats DateInterval, and how to bolt it onto a Laravel app whose framework still wants ints.

8 min read →
laravel

Extract a Package from Your Laravel App: The Complete Guide

Every team has an app/Support folder that's been copy-pasted into four projects. Here's how to extract it into a real Composer package without breaking the app it came from.

19 min read →
laravel

Route Support Tickets with Jev: Confidence-Gated Triage in Laravel

Send a support ticket to Jev once, get a typed department, an urgency probability and a frustration score back, then let confidence decide whether to assign it or hand it to a human.

11 min read →
livewire

Livewire 4 Interceptors: Hooking Every Request Without Touching a Component

Livewire 4 replaces the loading-bar hacks and the 419 handler you wrote twice with a real interceptor system. Three levels, and picking the wrong one is the first thing that goes wrong.

12 min read →
laravel

Let the Model Look Things Up: WebSearch, WebFetch and FileSearch in the Laravel AI SDK

Three lines of config give your agent the open web and your own documents. Here's how to enable them, which providers actually implement them, and what to lock down before it ships.

11 min read →
laravel

The Cache Hit You Still Paid For: Laravel's Memo Driver and Tagged Memoization

A Redis cache hit is still a network round trip. The memo driver collapses eleven reads of the same key into one — and as of Laravel 13.33 it finally works with tags.

10 min read →
php

Reuse the TLS Handshake: PHP 8.5 Persistent cURL Share Handles in Laravel

Every outbound HTTPS call from a PHP request starts from nothing — resolve, connect, handshake, then finally send. PHP 8.5 lets a worker keep that setup between requests, and Laravel 13 exposes it in one line.

11 min read →
php

Who Owns the Error Handler? PHP 8.5's get_error_handler() and get_exception_handler()

PHP 8.5 finally lets you read the current error and exception handler without setting one first. Here is how to use it to find whatever is swallowing your exceptions.

11 min read →
filament

Stop Scrolling Through a 40-Field Filament Form: Sections, Tabs and Flex

Filament resources start clean and accrete. Here is how to restructure a wall of inputs with Section, Fieldset, Tabs and Flex — and the traps in each.

12 min read →
filament

Filament v5 Performance: Making a 100,000-Row Panel Feel Instant

Filament is wonderful at 500 rows and miserable at 500,000. Almost none of that is Filament's fault - here is the ordered method for finding which of the eight usual causes is actually yours.

17 min read →
filament

Filament v5 Database Notifications: A Real-Time Drawer Backed by Reverb

The import finished twenty minutes ago and nobody told anyone. A toast cannot fix that — the notifications drawer can, once you understand the payload shape Filament actually queries for.

11 min read →
livewire

Livewire 4 Single-File Components: When to Put PHP and Blade in One File (and When Not To)

Livewire 4 makes view-based components the default, and make:livewire no longer writes to app/Livewire. Here is what actually changed and how to decide between one file and a component directory.

10 min read →
tooling

Renovate for Laravel: Automated Composer and npm Updates That Do Not Drown You in PRs

Renovate's default config opens a PR per package and buries the repository within a day. The value is entirely in packageRules — here is the Laravel configuration that turns forty PRs a week into one.

15 min read →
laravel

Serve Laravel's Vite Assets from a CDN with Immutable Cache Headers

Assets are the last thing anyone moves off the origin, and the move fails in two identical-looking ways. Here is the ASSET_URL one-liner, the cache header table, and the deploy step that stops mid-session users seeing a white screen.

16 min read →
laravel

Ask a Model About a PDF: Document Attachments in the Laravel AI SDK

A customer uploads a contract and asks a question about it. Here is how to answer it with a document attachment instead of a PDF parser or a week of RAG plumbing.

16 min read →
laravel

Laravel File Storage: The Complete Guide to Disks, Private Files, Direct Uploads and Signed URLs

Every Laravel app grows a file upload, and almost every one grows it the same wrong way: public disk, absolute URLs in the database, 300 MB videos through PHP, and a bucket full of objects nobody owns. This guide builds a private document library end to end on Laravel 13 — four disks, presigned browser uploads with a confirm step, three ways to serve a private file, validation that survives a spoofed MIME type, and the prune command nobody writes until the bill arrives.

28 min read →
php

The Widget That Forgets: Partitioned Cookies in PHP 8.5 and Laravel 13

PHP 8.5 finally lets setcookie() emit the Partitioned attribute. Here is how to use it, how Laravel 13 exposes it, and who should leave it alone.

10 min read →
filament

Stop Explaining Your Form in a Placeholder: Filament v5's Callout Component

Every Filament form eventually needs to say something that does not belong on a single field. v5.2 shipped a component for it, and almost nobody noticed.

11 min read →
laravel

Sort Users by Their Last Order Without an N+1: Eloquent Subquery Selects

An admin table needs a sortable Last ordered column. Eager loading fixes the query count but not the memory, and it cannot sort at all. The subquery select does both in four lines.

12 min read →
laravel

Stop Shipping Prompt Regressions: LLM Evals for the Laravel AI SDK with Pest 5

Your faked-agent tests prove the wiring works and tell you nothing about whether the output is still any good. Pest 5's evals plugin closes that gap.

15 min read →
php

PHP 8.4 mb_trim and mb_ucfirst: The Multibyte Gaps Everyone Polyfilled

Two customer rows look identical, and the unique index accepted both. One of them ends in a no-break space that trim() cannot see. PHP 8.4 finally shipped the fix.

10 min read →
laravel

The Job That Ran Before the Row Existed: Dispatching Inside Laravel Transactions

A queued job throws ModelNotFoundException for a row that plainly exists. It is not a bug in the job — it is a worker that got there before your transaction committed.

9 min read →
composer

Find the Composer Packages Your Laravel App Doesn't Actually Use

Every long-lived Laravel app carries packages nobody uses and packages nobody declared. Here is how to find both, survive the false-positive wall, and gate the check in CI.

10 min read →
tooling

Profile a Slow Laravel Endpoint: SPX, Blackfire and Reading a Flame Graph Properly

Everyone can generate a flame graph. Almost nobody can read one. Here is the loop from a four-second endpoint to a merged fix, and why Kernel::handle is never the answer.

15 min read →
laravel

Laravel Maintenance Mode That Actually Works: down --render, Secret Bypass and the Octane Trap

php artisan down boots the framework to tell you the framework is broken. Here are the four flags nobody sets, the multi-server failure everyone hits once, and what Octane quietly does to all of it.

9 min read →
laravel

Laravel Read Replicas: Route Reads to a Follower Without Serving Stale Data

The read/write split is four lines of config. The read-after-write bugs that turn up a fortnight later are the actual work — and sticky only covers one of them.

11 min read →
laravel

Laravel Secrets in Production: The Complete Guide to env:encrypt, Secrets Manager and Rotation

Almost every Laravel deployment guide stops at "put it in .env and don't commit it". That is the absence of a secrets strategy. Here are the three patterns that actually work, and how to rotate a credential without taking the site down.

24 min read →
filament

Tame a Bloated Filament v5 Sidebar with Clusters and Sub-Navigation

A cluster is not a navigation group — it re-prefixes URLs and rewrites breadcrumbs. Here's the retrofit path for moving existing Filament v5 resources into one without breaking links.

11 min read →
tailwind

Tailwind v4 Logical Properties: Ship RTL Layouts Without a Single rtl: Override

The logical utilities have been in Tailwind all along. Here is the full verified set, the conversion order that doesn't break your layout halfway, and what is still physical in v4.

9 min read →
php

json_validate() vs try/catch json_decode(): Checking JSON Without Building It

json_validate() landed in PHP 8.3 and immediately got used in the one place it makes things worse. Here is what it is actually for.

9 min read →
ai

Generate Speech from Text in Laravel with the AI SDK's Audio Class

The Laravel AI SDK turns text-to-speech into four lines and hands you a Storage path instead of a byte string. Here is the whole surface — voices, queueing, serving — plus the hash cache that stops you paying twice for the same sentence.

10 min read →
laravel-ai-sdk

Transcribe Audio in Laravel with the AI SDK: Uploads, Storage and Speaker Diarization

Transcription ships in the Laravel AI SDK with queueing, diarization and faking built in. Almost nobody knows it's there, so here's the whole path.

8 min read →
laravel

Run Laravel Behind PgBouncer in Transaction Mode Without Breaking Booleans

PgBouncer's transaction mode breaks PDO prepared statements, and the classic emulated-prepares workaround then breaks your boolean columns. Laravel 13.17 fixes both properly.

11 min read →
laravel

Laravel Sanctum in Production: API Tokens, Abilities and SPA Sessions

Sanctum is two unrelated authentication mechanisms sharing one package name, and almost every tutorial only covers half of one of them. This guide builds a real Orders API end to end: scoped tokens, an ability vocabulary that survives a year of growth, the tokenCan() hole nobody warns you about, expiry and pruning, full SPA cookie auth, per-token rate limiting, and Pest tests for all of it.

22 min read →
devops

Migrate a Laravel App from Redis to Valkey Without Changing a Line of Code

A Laravel Valkey migration runbook: what actually differs, how to move the persisted data instead of cold-starting, and how to sequence cache, sessions and queues so a mistake costs a cache miss rather than a lost job.

13 min read →
laravel

Stop Wrapping Everything in try/catch: Renderable and Reportable Exceptions in Laravel 13

Your controllers are full of the same three catch blocks. Move the response into the exception's render() method and the log context into context(), and most of them disappear.

12 min read →
filament

Add Soft Deletes to a Filament v5 Resource: Trashed Filter, Restore and Force Delete

The scaffold flag only helps on a brand new resource. Here's the retrofit path for soft deletes on an existing Filament v5 resource — including the query override that fixes the 404 on a trashed record.

11 min read →
filament

Turn a Filament v5 Create Page Into a Multi-Step Wizard

A 20-field create form is a wall users scroll past. The HasWizard trait splits it into validated steps without touching the resource schema your edit page still uses.

10 min read →
livewire

Build a Debounced Live Search Input in Livewire 4 Without Hammering Your Database

A naive wire:model.live search turns every keystroke into a full round trip. Here's the debounce window, computed query, pagination reset and index that make it feel instant.

11 min read →
livewire

Integrating Third-Party JavaScript with Livewire 4: The Complete Guide

Every third-party JavaScript bug in Livewire has the same root cause: the library mutated the DOM and morph doesn't know. Here's the full mental model, then the whole toolkit — wire:ignore, wire:replace, $wire, @persist and the morph hooks — each paired with the failure it fixes.

20 min read →
pest

Build Custom Pest Expectations for Your Laravel Domain Language

Turn the six-line assertion blocks you keep pasting between tests into named expectations like expect($order)->toBeFulfilled(), then ship them as a package.

10 min read →
phpstan

Write a Custom PHPStan Rule to Enforce Your Laravel Conventions

Some conventions live only in reviewers' heads, so they rot. A PHPStan custom rule moves one of them into CI permanently — here is the whole build, including the test.

11 min read →
php

PHP Randomizer Engines: Choosing Between Secure, Seeded and Fast Randomness in Laravel

Two problems with one root cause: tokens that are guessable, and tests that are flaky. PHP's Random extension fixes both, once you pick the right engine.

9 min read →
php

The #[\Override] Attribute: Catching Broken Laravel Inheritance at Compile Time

PHP 8.3's #[\Override] attribute converts a whole class of silent inheritance bugs into loud compile-time errors. Here's where it pays off in a real Laravel app — and the four places it will blow up in your face.

7 min read →
php

Switch Laravel to Immutable Dates with CarbonImmutable

Carbon extends DateTime, so every modifier rewrites the object you called it on. Here is how to move a Laravel app onto CarbonImmutable end to end.

7 min read →
laravel

PCOV vs Xdebug for Laravel Code Coverage

Coverage needs a driver, and the one you pick decides whether your suite runs in seconds or minutes. Here is how PCOV and Xdebug actually differ, and how to wire each one up locally and in CI.

9 min read →
laravel

Tune OPcache and Preloading for Laravel in Production

Most Laravel apps run OPcache on defaults and never touch preloading. Here are the production ini values, a focused preload script, and the deploy step that stops you serving stale bytecode.

11 min read →
laravel-ai-sdk

Generate and Store Images with the Laravel AI SDK

The AI SDK docs lead with text, so most people reach for a raw HTTP client to generate images. There's a first-class API for it — here's how I wire it up.

10 min read →
laravel

Manage Laravel AI SDK Prompts as Versioned Blade Templates

Heredoc prompts buried in service classes cannot be diffed, reviewed or rolled back. Here is how I move them into versioned Blade templates that CI can catch.

9 min read →
livewire

Skip Re-Rendering Livewire 4 Actions with #[Renderless]

An analytics ping shouldn't re-render your component and ship a DOM diff. Livewire's render phase is opt-out — here are the three ways to skip it, and when skipping it silently breaks your UI.

7 min read →
livewire

Communicate Between Livewire 4 Components with dispatch and #[On]

Props flow parent-to-child, but sending data back up or sideways needs events. Here is how dispatch(), #[On] and targeted dispatches actually behave in Livewire 4.

9 min read →
filament

Test Filament v5 Resources with Pest

Filament resource pages are Livewire components, not URLs. Point livewire() at the page class and you get table, form and action assertions that run in milliseconds.

8 min read →
filament

Filament v5 Authorization: Policies, Roles and Permissions Complete Guide

A policy alone will not stop a user seeing every row in your table. Here are the four layers of Filament v5 authorization - panel access, policies, query scoping and field visibility - wired together and covered by tests.

18 min read →
pint

Share One Laravel Pint Config Across Every Project

Every repo ends up with a slightly different pint.json, and formatting drifts until code review is nothing but style nits. Here is how I ship one canonical Pint config as a Composer package and point every project at it.

9 min read →
livewire

Stream a File Download from a Livewire 4 Action

A Livewire action can return a Laravel download response directly, so a button click can hand back a stored PDF or a CSV generated on the fly with no extra route.

7 min read →
laravel

Blue-Green Deployments for Laravel with an Nginx Upstream Switch

Symlink deploys share one PHP-FPM pool and one OPcache, so rollback is never instant. Here's how to run two complete Laravel environments and flip traffic with a single Nginx reload.

10 min read →
devops

Add a Docker HEALTHCHECK to a Laravel Queue Worker Container

A worker container reports Up 3 days while the queue backs up. Here's how to give Docker a real liveness signal for queue:work and Horizon.

8 min read →
laravel

Add Input and Output Guardrails to a Laravel AI SDK Agent

The Laravel AI SDK ships no moderation API, but it does give you one clean interception seam. Here is how I wrap an agent with input and output guardrails using agent middleware.

9 min read →
Laravel AI SDK

Cut LLM Costs with a Semantic Response Cache in the Laravel AI SDK

Exact-match caching never fires on natural-language prompts. Here's how I cache LLM responses by meaning using embeddings, pgvector, and the Laravel AI SDK.

10 min read →
laravel

Set Up a Fast Local Laravel Environment with Herd

Get a native Laravel dev environment running on macOS with Herd — no Docker, no Homebrew PHP. Install, serve on .test, pin PHP, and add HTTPS.

7 min read →
laravel

Keep Laravel Queue Workers Alive with Supervisor in Production

A hand-started queue worker dies on the first fatal error or reboot. Here's the Supervisor config that keeps php artisan queue:work running for good.

5 min read →
laravel

Build Multi-Agent Workflows with the Laravel AI SDK

One agent with a dozen tools and a bloated prompt gets flaky fast. Here's how to split the work across a coordinator and focused specialists with the Laravel AI SDK.

8 min read →
Filament

Upgrade to Filament v5: A Step-by-Step Migration Guide from v4

Filament v5's only real change is Livewire 4 support - so the upgrade is mostly running one script. Here's the full path, plus the Livewire 4 edits and plugin checks that actually need your attention.

12 min read →
laravel

Give Laravel AI SDK Agents External Tools with MCP Servers

Stop hand-writing a tool for every capability. Register an MCP client, authenticate it, and spread its tools straight into your Laravel AI SDK agent.

8 min read →
laravel

Refactor Messy Conditionals with Laravel's Pipeline Facade

That forty-line filter() method full of nested ifs? Laravel's Pipeline facade turns it into small, swappable, individually testable stages — with a worked query-filter example.

7 min read →
laravel

Run Laravel AI SDK Agents in the Background with Queued Jobs

A synchronous AI call can tie up a PHP worker for half a minute. Here's how to run Laravel AI SDK agents on a queue and surface the result when it's done.

7 min read →
filament

Add Status Tabs with Counts to a Filament v5 List Page

Filament tables can be filtered, but the filter form hides behind a button. For a fixed set of states like order status, tabs put always-visible, counted query scopes right above the table.

8 min read →
laravel

Auto-Delete Stale Records with Laravel's Prunable Trait

Some tables only ever grow. Here's how Laravel's Prunable trait deletes stale rows on a schedule — safely, in chunks, with a hook for cleaning up related files.

6 min read →
livewire

Build a Real-Time Chat App with Livewire 4 and Reverb

Most chat tutorials stop at 'message appears' and lean on Pusher. This is the end-to-end, first-party build: Reverb, DB-first persistence, private and presence channels, typing indicators, channel auth, and deployment — with no hand-written message JS.

18 min read →
filament

Build a Global Settings Page in Filament v4 with spatie/laravel-settings

Most apps need editable global settings without a code deploy. Here's the clean Filament v4 path: a typed spatie settings class, a scaffolded page, an auto-bound form, and locked-down access.

7 min read →
livewire

Protect Livewire 4 Properties from Client-Side Tampering with #[Locked]

Every public Livewire property is sent to the browser and accepted back, so a user can rewrite it in DevTools. #[Locked] shuts that door for the properties that matter.

6 min read →
laravel

Persist Multi-Turn Chat History with the Laravel AI SDK

A stateless agent forgets every turn. Here's how to wire persistent conversation memory into a Laravel AI SDK agent, resume a chat by ID, and stop long histories from wrecking your token budget.

7 min read →
github-actions

Cache Composer and NPM in GitHub Actions to Speed Up Laravel CI

Cache Composer's download directory and the npm cache in GitHub Actions, keyed on your lockfiles, so composer install and the asset build finish in seconds.

7 min read →
laravel

Run Independent Work in Parallel with Laravel's Concurrency Facade

Turn six sequential dashboard queries into one parallel batch. A practical look at Laravel's Concurrency facade — run(), defer(), the three drivers, and when a queue is still the right call.

7 min read →
laravel

Deploy Laravel to a VPS with Kamal 2: A Complete Guide

Kubernetes is overkill and click-ops doesn't scale. Kamal 2 deploys a containerised Laravel app to a plain VPS over SSH, with zero-downtime cutover and automatic SSL from a single config file.

16 min read →
filament

Build Custom Table Filters in Filament v4

Past SelectFilter and TernaryFilter: build a custom Filament v4 filter from a form schema and a query() callback, add a date range, and wire up indicators.

8 min read →
Laravel AI SDK

Track Token Usage and Cost with the Laravel AI SDK

Every Laravel AI SDK response carries a usage object. Here's how to capture it, attribute it to a user and feature, and turn tokens into a real cost dashboard.

8 min read →
duster

Duster: Run Pint, PHPStan, and Rector with One Command

A mature Laravel app ends up with four code-quality tools, four configs, and four CI steps. Here's how Duster collapses them into one command — and when that's actually worth it.

7 min read →
peck

Catch Spelling Mistakes in Your Laravel Codebase with Peck

Typos harden into method names, routes, and API fields you can't rename without a breaking change. Here's how I wire Peck into a Laravel project to catch them before they ship.

7 min read →
devops

Run the Laravel Scheduler in a Docker Container the Right Way

The classic crontab line assumes a host cron that containers don't ship. Here are the two clean ways to run schedule:run in a container — supercronic and a Kubernetes CronJob.

7 min read →
laravel

Zero-Downtime Database Migrations in Laravel: The Expand and Contract Pattern

Renaming a column in production is a classic self-inflicted outage. Here is the expand and contract playbook that ships breaking schema changes in Laravel with zero downtime and an instant rollback path.

14 min read →
laravel

Automated Laravel Database Backups to S3 with spatie/laravel-backup

Wire up off-site, encrypted, self-pruning Laravel database backups to S3 with spatie/laravel-backup — scheduling, retention, and failure alerts included.

8 min read →
laravel

Laravel Context: Request Data That Follows Your Logs and Jobs

Stop threading a request ID through every log call. Laravel Context sets it once in middleware and follows the request into every queued job it dispatches.

6 min read →
laravel

Laravel AI SDK Tool Calling: Let the Model Run Your PHP

Give a Laravel AI agent real abilities: typed PHP tools the model can call to look up data, with enum-constrained inputs and a hard cap on runaway loops.

7 min read →
tailwind

Tailwind v4 @reference: Fix @apply in Blade & Scoped CSS

Tailwind v4 resolves @apply against the theme in the current file, so a second CSS bundle throws 'unknown utility class'. Here's how @reference fixes it without duplicating output.

7 min read →
filament

Filament v4 Infolists: Build Read-Only Record Views

Filament's default View page renders a greyed-out, disabled form. Here's how to replace it with a proper read-only infolist — entries, formatting, layout, and reuse in a table modal.

7 min read →
livewire

Livewire 4 Slots: Pass Content Into Components Like Blade

Livewire 4 finally brings Blade-style default and named slots to full components. Here's how to use them to build reusable modal, card, and panel shells.

7 min read →
pest

Measure Test Quality, Not Just Coverage: Pest Mutation Testing

100% line coverage can still ship bugs. Here's how Pest's mutation testing finds the assertions your test suite is quietly missing.

7 min read →
filament

Build a Stats Overview Widget with Trend Sparklines in Filament v4

The Filament docs show a stat card with a hardcoded value and a fake sparkline. Here's the same widget wired to real period-over-period queries, delta-driven colours, and live polling.

6 min read →
livewire

Fix Child Components That Won't Update with Livewire 4 #[Reactive] Props

Livewire props aren't reactive by default, so a parent can change a value and the child never notices. Here's the one-attribute fix, and when events are the better call.

6 min read →
laravel

Test AI Features Without Calling the API: Agent::fake() in the Laravel AI SDK

You shipped an agent and wrote zero tests for it, because hitting a real model is slow, costs tokens, and needs a key in CI. The Laravel AI SDK's fake() fixes all three.

8 min read →
laravel

The Complete Guide to Caching in Laravel: Tags, Locks, and Invalidation

Most Laravel developers know Cache::remember and stop there. This guide goes the whole way: drivers, stale-while-revalidate, cache tags, atomic locks for stampedes, and an invalidation strategy that survives production.

18 min read →
livewire

Build a Multi-Step Wizard Form in Livewire 4 with Per-Step Validation

Reach for a package and you inherit its opinions. A multi-step wizard is just one Livewire component with a step counter and validation scoped to the step you're on.

10 min read →
tailwind

Safelist Dynamic Blade Classes in Tailwind v4 with @source inline()

A Blade class like bg-{{ $color }}-500 works locally then disappears in production. Here's the Tailwind v4 fix with @source inline().

6 min read →
laravel

Centralized Laravel Logging with Grafana Loki and Alloy

Stop SSHing into boxes to grep laravel.log. Aggregate structured logs from every Laravel instance into Grafana Loki, then query and alert on them.

9 min read →
laravel-ai-sdk

Analyze Images with the Laravel AI SDK: Vision and Multimodal Prompts

The Laravel AI SDK does more than generate text. Here's how to attach an image to a prompt and have a vision model describe, classify, or extract data from it.

7 min read →
laravel

Tail Laravel Logs in Real Time with Pail (Filters, Levels, and Users)

Stop scrolling storage/logs/laravel.log. Pail gives you a filtered, driver-agnostic live log stream right in your terminal.

6 min read →
laravel

The Complete Guide to Production Observability in Laravel: Pulse, Nightwatch, and OpenTelemetry

Most Laravel teams ship to production with nothing but log files. This guide wires up the three pillars of observability — metrics, traces, and logs — with Pulse, Nightwatch, and OpenTelemetry, then builds an alerting strategy around the golden signals.

17 min read →
laravel

Catch N+1 Queries Early with Eloquent Strict Mode

Turn N+1 queries into loud exceptions in development instead of silent latency in production. Here's what Eloquent strict mode does and exactly where to switch it on.

6 min read →
laravel

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.

7 min read →
laravel

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.

8 min read →
php

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.

7 min read →
tailwind

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.

8 min read →
pest

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.

8 min read →
laravel

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.

7 min read →
laravel

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.

8 min read →
laravel

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.

7 min read →
laravel

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.

19 min read →
laravel

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.

9 min read →
pest

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.

9 min read →
livewire

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.

7 min read →
filament

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.

7 min read →
filament

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.

10 min read →
laravel

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.

16 min read →
pest

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.

8 min read →
ai

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.

11 min read →
filament

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.

13 min read →
livewire

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.

21 min read →
livewire

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.

12 min read →
livewire

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.

11 min read →
livewire

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.

10 min read →
livewire

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.

10 min read →
livewire

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.

9 min read →
laravel

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.

8 min read →
tailwind

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.

10 min read →
tailwind

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.

11 min read →
filament

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.

10 min read →
filament

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.

10 min read →
filament

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.

10 min read →
stripe

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.

11 min read →
laravel

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.

9 min read →
laravel

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.

8 min read →
laravel

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.

10 min read →
laravel

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.

18 min read →
pest

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.

9 min read →
stripe

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.

8 min read →
laravel

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.

9 min read →
php

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.

10 min read →
rector

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.

8 min read →
laravel

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.

18 min read →
stripe

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.

9 min read →
laravel

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.

8 min read →
livewire

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.

7 min read →
laravel

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.

7 min read →
laravel

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.

8 min read →
laravel

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.

6 min read →
laravel

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.

7 min read →
stripe

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.

7 min read →
devops

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.

6 min read →
laravel

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.

9 min read →
laravel

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.

6 min read →
laravel

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.

6 min read →
laravel

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.

21 min read →
laravel

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.

6 min read →
laravel

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.

6 min read →
laravel

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.

8 min read →
laravel

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.

7 min read →
laravel

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.

8 min read →
laravel

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.

7 min read →
laravel

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.

6 min read →
laravel

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.

7 min read →
laravel

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.

17 min read →
laravel

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.

4 min read →
laravel

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.

8 min read →
laravel

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.

6 min read →
laravel

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.

5 min read →
devops

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.

8 min read →
stripe

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.

6 min read →
docker

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.

7 min read →
laravel

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.

5 min read →
php

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.

5 min read →
php

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.

6 min read →
laravel

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.

5 min read →
stripe

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.

4 min read →
laravel

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.

5 min read →
laravel

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.

16 min read →
laravel

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.

6 min read →
laravel

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.

8 min read →
stripe

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.

6 min read →
pest

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.

5 min read →
laravel

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.

5 min read →
laravel

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.

6 min read →
laravel

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.

5 min read →
laravel

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.

18 min read →
laravel

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.

4 min read →
php

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.

4 min read →
stripe

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.

5 min read →
Laravel

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.

5 min read →
Laravel

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.

4 min read →
Laravel

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.

3 min read →
Laravel

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.

4 min read →