Laravel | Blog | Mozex                        [ Skip to content ](#main-content)   [                  ozex Labs ](https://mozex.dev) [About](https://mozex.dev#about) [Projects](https://mozex.dev#projects) [Open Source](https://mozex.dev#open-source) [Services](https://mozex.dev#services) [Docs](https://mozex.dev/docs) [Blog](https://mozex.dev/blog) [ Get in Touch ](https://mozex.dev#contact) 

        [About](https://mozex.dev#about) [Projects](https://mozex.dev#projects) [Open Source](https://mozex.dev#open-source) [Services](https://mozex.dev#services) [Docs](https://mozex.dev/docs) [Blog](https://mozex.dev/blog) [ Get in Touch ](https://mozex.dev#contact) 

     [   Back to Blog ](https://mozex.dev/blog) Tagged: Laravel 
=================

     [ Migrate WordPress Users to Laravel Without a Password Reset 
-------------------------------------------------------------

 ](https://mozex.dev/blog/30-migrate-wordpress-users-to-laravel-without-a-password-reset) I built a WordPress site in Docker to see what a wp\_users table holds after WordPress's move to bcrypt: WordPress 6.7.9 first, then an upgrade to 7.1.2, with users created on both versions. Then I copied its eight users, hashes intact, into a fresh Laravel 13.33 app on PHP 8.5 and tried to log each one in. Seven of the eight logins threw RuntimeException: This password does not use the Bcrypt algorithm. The right password threw it, and so did a wrong one. WordPress has hashed passwords with bcrypt since 6.8, and Laravel uses bcrypt too, so this looks like it should just work. It fails for two separate reasons, and one of them never shows an error. If you only need the fix, it's two steps: import the rows with the query builder, then register a hasher that knows WordPress's formats. Laravel then replaces each user's hash with a Laravel bcrypt hash on their first login.

   Oct 2, 2026   ·  10 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ WooCommerce ](https://mozex.dev/blog/tags/woocommerce)  

  [ Laravel Tests Fail When Two Runs Overlap, Even With --parallel 
----------------------------------------------------------------

 ](https://mozex.dev/blog/29-laravel-tests-fail-when-two-runs-overlap-even-with-parallel) Whenever two test commands ran inside one of my projects at the same time, they failed, because one run would clear the database under the other. It happened especially when I asked a Claude Code session to hand work to sub-agents: each sub-agent ran the tests for its own change, the runs failed, and it became a loop of discovering the problem and running it again. For this post I reproduced it on a fresh Laravel app whose phpunit.xml points at MySQL, with 1,201 tests, 1,200 of them using RefreshDatabase. Run alone, before any fix, the suite passes in under a minute. I started php artisan test twice at the same moment, three times. All six runs failed 1,167 to 1,200 of their 1,201 tests, and each took 3.5 to 4.4 minutes. The fix is my package mozex/laravel-test-lanes. Install it with composer require mozex/laravel-test-lanes --dev and there's nothing else to set up. With it, those runs pass. Everything here ran on Laravel 13.33, PHP 8.5, PHPUnit 12.5 with ParaTest 7.20, and MySQL 8.4 on Windows 11, with version 1.1.1 of the package (Laravel 11 to 13, PHP 8.2+, MySQL, MariaDB and PostgreSQL).

   Sep 30, 2026   ·  7 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Testing ](https://mozex.dev/blog/tags/testing) [ Open Source ](https://mozex.dev/blog/tags/open-source) [ Database ](https://mozex.dev/blog/tags/database)  

  [ Parallel Claude Code Sessions in Laravel: A Copied .env Shares Your MySQL Database 
------------------------------------------------------------------------------------

 ](https://mozex.dev/blog/28-parallel-claude-code-sessions-in-laravel-a-copied-env-shares-your-mysql-database) I'd have a Claude Code session working in a project and want to get on with something else while it ran. A second session in the same checkout wasn't the answer: neither session would know the other was working, so they'd interfere with each other's work and end up reverting each other's changes. Running two test commands at once caused problems too, because both ran against one database. Git worktrees fix the files: each session gets its own directory and branch. In a worktree with a copied .env, one migrate:fresh took the main checkout's users table in my test app from 1,000 rows to 0. I built mozex/laravel-worktree for this problem: one command gives each worktree its own database, test database, .env and Herd site. If you'd rather script it yourself, read the section on unsetting the parent's environment first, because the obvious Artisan command still emptied the main database in my test. Everything here ran on a fresh Laravel 13.33 app with MySQL 8.4 and PHP 8.5, served by Laravel Herd 1.30 on Windows 11, with version 1.6.0 of the package (it supports Laravel 11 to 13, PHP 8.2+, MariaDB and PostgreSQL; WORKTREE\_HERD=none skips Herd).

   Sep 28, 2026   ·  10 min read   ·  [ Claude Code ](https://mozex.dev/blog/tags/claude-code) [ Developer Tools ](https://mozex.dev/blog/tags/developer-tools) [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Open Source ](https://mozex.dev/blog/tags/open-source)  

  [ Laravel 12 to 13: The Config Sync That Logs Users Out and Breaks the Cache 
----------------------------------------------------------------------------

 ](https://mozex.dev/blog/27-laravel-12-to-13-the-config-sync-that-logs-users-out-and-breaks-the-cache) I upgraded a Laravel 12 app to 13 in two stages and recorded what each stage did to its cache, its sessions and its queue. The app came from the laravel/laravel 12.0.11 skeleton (June 2025), ran framework 12.69.2, and used Redis for all three. Before the upgrade it held 14 cached values, one logged-in visitor and one queued job. composer update to 13.33.0 changed none of that. All 14 values read back, the visitor stayed logged in, the job waited. Then I copied the 13 skeleton's config/cache.php, config/session.php and config/database.php over the app's, one file at a time. Every cached key missed, the visitor was logged out, the job vanished from the worker's view, and a cached Eloquent collection came back as \_\_PHP\_Incomplete\_Class.

   Sep 25, 2026   ·  11 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ DevOps ](https://mozex.dev/blog/tags/devops)  

  [ Laravel chunk vs lazy vs cursor: lazy() Is as Slow as chunk() 
---------------------------------------------------------------

 ](https://mozex.dev/blog/26-laravel-chunk-vs-lazy-vs-cursor-lazy-is-as-slow-as-chunk) I seeded a MySQL table with 1,000,000 orders and walked through every row with each of five Laravel methods for iterating a big query: chunk(), chunkById(), lazy(), lazyById() and cursor(). chunkById() finished in 21.9 seconds and lazyById() in 22.3, neither above 5.9 MB of PHP memory. chunk() and lazy() held just as little and took about six times as long. cursor(), which the Laravel docs offer as a way to "significantly reduce your application's memory consumption", finished behind both ById methods and held 100.4 MB.

   Sep 23, 2026   ·  9 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Performance ](https://mozex.dev/blog/tags/performance) [ Database ](https://mozex.dev/blog/tags/database)  

  [ ShouldBeUnique vs WithoutOverlapping: Neither Sets a Lock Expiry for You 
--------------------------------------------------------------------------

 ](https://mozex.dev/blog/25-shouldbeunique-vs-withoutoverlapping-neither-sets-a-lock-expiry-for-you) Here's a key that was sitting in my Redis a few minutes ago: $ redis-cli --scan --pattern "\*overlap\*" laravel-database-laravel-cache-laravel-queue-overlap:App\\Jobs\\SyncFeed:feed $ redis-cli TTL "laravel-database-laravel-cache-laravel-queue-overlap:App\\Jobs\\SyncFeed:feed" -1 A TTL of -1 is Redis for "this key exists and nothing will expire it". Its owner is a worker process I killed a minute earlier. The job it was protecting never finished and never will: it's in failed\_jobs with a MaxAttemptsExceededException. Every later dispatch of SyncFeed fails the same way. Laravel calls four different things a lock, and ShouldBeUnique and WithoutOverlapping are two of them. This post puts all four side by side in a scratch app on Laravel 13.32.0, PHP 8.5, with Redis 8 and the database store on SQLite: the key each one writes, the default expiry, where the lock is taken, where it's given back, and what can clear it when something goes wrong.

   Sep 21, 2026   ·  14 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ DevOps ](https://mozex.dev/blog/tags/devops)  

  [ Anthropic Prompt Caching in Laravel: A Practical Guide 
--------------------------------------------------------

 ](https://mozex.dev/blog/18-anthropic-prompt-caching-in-laravel-a-practical-guide) Running Sevantia, our AI chat product, I watched the same 2,800-token system prompt get re-billed on every single user message. Multiply that by thousands of conversations a day and you're paying Anthropic to re-read the same instructions into Claude's context over and over. Prompt caching fixes this. It took me longer than it should have to get the mental model right, and the docs skip over the parts that trip up most people. This is the guide I wish I'd had when I first enabled it.

   Apr 20, 2026   ·  9 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ AI ](https://mozex.dev/blog/tags/ai) [ Tutorial ](https://mozex.dev/blog/tags/tutorial) [ Anthropic ](https://mozex.dev/blog/tags/anthropic)  

  [ 5 Laravel Scheduler Failures That Only Show Up in Production 
--------------------------------------------------------------

 ](https://mozex.dev/blog/17-5-laravel-scheduler-failures-that-only-show-up-in-production) "But it worked locally." The Laravel scheduler is the duct tape of every production app I've worked on. It triggers the reports, cleans up expired data, pings the health checks, rotates the tokens, sends the digests. It works quietly for weeks, then one morning the team realises nothing has run for six days and nobody got an alert. If you've already read my queue worker version of this list, the scheduler has its own set of silent failure modes. Every one below cost me or a client real money or real trust. None of them show up in php artisan schedule:list. All of them are avoidable once you know where to look. Examples target Laravel 11 and later (so routes/console.php and bootstrap/app.php). On Laravel 10 and earlier, the same calls live in the schedule() method of App\\Console\\Kernel.

   Apr 15, 2026   ·  10 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ DevOps ](https://mozex.dev/blog/tags/devops)  

  [ The Laravel Bug Your Tests Will Never Catch 
---------------------------------------------

 ](https://mozex.dev/blog/16-the-laravel-bug-your-tests-will-never-catch) In a previous post, I listed "your job runs before the data exists" as one of five queue failures that only show up in production. I showed the afterCommit() fix and moved on. But that post didn't answer the question that kept nagging me: why do your tests always pass when this bug is sitting right in your code? And where else in your app is this same timing problem hiding, beyond direct dispatch() calls? This post digs into both.

   Apr 15, 2026   ·  7 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Testing ](https://mozex.dev/blog/tags/testing) [ Database ](https://mozex.dev/blog/tags/database)  

  [ How I Audit a New Laravel Codebase in 30 Minutes 
--------------------------------------------------

 ](https://mozex.dev/blog/15-how-i-audit-a-new-laravel-codebase-in-30-minutes) When a client asks me to look at their Laravel application, I don't start by reading code. I run a specific sequence of checks that tells me more in 30 minutes than reading source files for a full day would. This isn't a full audit. It's triage. After working with Laravel for over a decade, I've found that a handful of structural checks reveal 80% of the problems. The patterns are surprisingly consistent. Here's the exact process I follow.

   Apr 13, 2026   ·  9 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Architecture ](https://mozex.dev/blog/tags/architecture) [ Code Review ](https://mozex.dev/blog/tags/code-review)  

  [ A Practical Guide to Database Indexing in Laravel 
---------------------------------------------------

 ](https://mozex.dev/blog/14-a-practical-guide-to-database-indexing-in-laravel) Your queries work fine in development. Fifty rows, instant responses, no complaints. Then you deploy to production, real data piles up, and a page that loaded in 200ms takes four seconds. The problem usually isn't your Eloquent code. It's the indexes you forgot to add.

   Apr 9, 2026   ·  11 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Tutorial ](https://mozex.dev/blog/tags/tutorial) [ Performance ](https://mozex.dev/blog/tags/performance) [ Database ](https://mozex.dev/blog/tags/database)  

  [ Building a Production-Ready Laravel MCP Server 
------------------------------------------------

 ](https://mozex.dev/blog/13-building-a-production-ready-laravel-mcp-server) Every Laravel developer has seen the MCP hype by now. Laravel's tagline changed to "The clean stack for Artisans and agents." The laravel/mcp package landed, tutorials appeared overnight, and suddenly everyone's building weather tools. But those tutorials stop right where real questions start. How do you authenticate AI clients hitting your server? What happens when an agent sends garbage to a tool that writes to your database? Should you even use MCP, or is your REST API already enough? I've been digging into this for a project, and these are the decisions and patterns I wish someone had documented before I started.

   Apr 8, 2026   ·  9 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ AI ](https://mozex.dev/blog/tags/ai) [ MCP ](https://mozex.dev/blog/tags/mcp)  

  [ 5 Laravel Queue Failures That Only Show Up in Production 
----------------------------------------------------------

 ](https://mozex.dev/blog/12-5-laravel-queue-failures-that-only-show-up-in-production) Your queue works perfectly in local. Every job dispatches, processes, and completes without a hitch. Then you deploy to production with real traffic, real concurrency, and real third-party APIs, and things start breaking in ways your test suite never predicted. I've been running Laravel queues in production for years across multiple applications. Every failure on this list caught me off guard at least once. Not because the documentation doesn't cover them, but because you don't think about them until they bite you at 2 AM.

   Apr 7, 2026   ·  7 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ DevOps ](https://mozex.dev/blog/tags/devops)  

  [ Use Laravel's route(), url(), and asset() Helpers Inside Markdown 
-------------------------------------------------------------------

 ](https://mozex.dev/blog/11-use-laravels-route-url-and-asset-helpers-inside-markdown) I had a Laravel project designed to be white-labeled. Swap an env file, change the domain, and the whole application launches as a completely different product. The problem was the Markdown files.

   Apr 6, 2026   ·  5 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Open Source ](https://mozex.dev/blog/tags/open-source) [ Markdown ](https://mozex.dev/blog/tags/markdown)  

  [ How a Rejected PR Became Laravel Scout Bulk Actions 
-----------------------------------------------------

 ](https://mozex.dev/blog/10-how-a-rejected-pr-became-laravel-scout-bulk-actions) If you've used Laravel Scout on a project with more than a couple of searchable models, you know the drill. You change something in your toSearchableArray(), and now you need to flush and reimport every model's index. Two commands per model. Manually. One at a time. On a project with ten searchable models, that's twenty commands to rebuild your search indexes.

   Apr 3, 2026   ·  4 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Open Source ](https://mozex.dev/blog/tags/open-source)  

        [ Older posts   ](https://mozex.dev/blog/tags/laravel?page=2)   

###  Stay in the Loop 

 Get the latest posts delivered to your inbox - on your schedule.

   Every New Post Weekly Digest Monthly Digest  

  Subscribe   Subscribing...     No spam. Unsubscribe anytime.

   ![Mozex](https://mozex.dev/images/mozex/profile-256.webp)###  Mozex 

 Laravel Specialist

 Senior Laravel Specialist &amp; Consultant. Building developer tools and open-source packages.

 [   ](https://github.com/mozex) [   ](https://www.linkedin.com/in/mozex) [   ](https://x.com/mozexdev) [   ](https://mozex.dev/blog/feed) 

###  Browse by Topic 

  [ Laravel  21  ](https://mozex.dev/blog/tags/laravel) [ PHP  21  ](https://mozex.dev/blog/tags/php) [ Open Source  7  ](https://mozex.dev/blog/tags/open-source) [ DevOps  5  ](https://mozex.dev/blog/tags/devops) [ Developer Tools  4  ](https://mozex.dev/blog/tags/developer-tools) [ Database  4  ](https://mozex.dev/blog/tags/database) [ AI  4  ](https://mozex.dev/blog/tags/ai) [ Claude Code  3  ](https://mozex.dev/blog/tags/claude-code) [ Testing  3  ](https://mozex.dev/blog/tags/testing) [ Performance  3  ](https://mozex.dev/blog/tags/performance) [ Architecture  3  ](https://mozex.dev/blog/tags/architecture) [ Tutorial  3  ](https://mozex.dev/blog/tags/tutorial) [ Bash  2  ](https://mozex.dev/blog/tags/bash) [ Anthropic  2  ](https://mozex.dev/blog/tags/anthropic) [ WooCommerce  2  ](https://mozex.dev/blog/tags/woocommerce) [ Productivity  1  ](https://mozex.dev/blog/tags/productivity) [ Markdown  1  ](https://mozex.dev/blog/tags/markdown) [ MCP  1  ](https://mozex.dev/blog/tags/mcp) [ GitHub Actions  1  ](https://mozex.dev/blog/tags/github-actions) [ Pest  1  ](https://mozex.dev/blog/tags/pest) [ Code Review  1  ](https://mozex.dev/blog/tags/code-review) [ Windows  1  ](https://mozex.dev/blog/tags/windows)  

###  Need expert Laravel help? 

 I offer consulting, code reviews, and custom development for Laravel applications.

 [ View Services   ](https://mozex.dev#services) 

   Live across open source

  1,351,498+  

 package downloads and counting

  Mozex Labs  [     Iminify, our free image compressor ](https://www.iminify.com) 

 [   ](https://github.com/mozex) [   ](https://www.linkedin.com/in/mozex) [   ](https://x.com/mozexdev) [   ](mailto:hello@mozex.dev) [   ](https://mozex.dev/blog/feed) 

  © 2026 Mozex Labs
