A Laravel application doesn't become “production-ready” when the feature works.
It's production-ready when you've thought about what happens when:
→ the queue worker dies halfway through a job
→ the database connection drops
→ two requests update the same record
→ a third-party API times out
→ a deployment happens during a long-running job
→ a database replica hasn't caught up yet
→ traffic suddenly becomes 10× higher
The happy path is the easy part.
Production engineering is designing for everything around it.
#Laravel #PHP
One deployment security setting I think more teams should care about:
Your deployment process shouldn't have permission to modify your source code.
Read-only GitHub access for deployments makes sense because a deployment only needs to:
→ read the repository
→ build the application
→ deploy it
It doesn't need to:
→ push commits
→ delete branches
→ modify the repository
Least privilege isn't just for production servers.
Your CI/CD pipeline should have it too.
Small permission.
Big security improvement.
#Laravel #PHP #DevOps
There's a failure mode in AI tool code that looks like the model being flaky and is actually your own code disagreeing with itself.
A developer writing MCP tools for an ERP described it in a pull request. Each tool had a schema() method describing its arguments to the agent, and a handle() method validating the same arguments with normal Laravel rules. By the third tool, every field existed twice. Change a max in the rules, forget the schema, and the agent keeps sending input that fits the old limit while the validator rejects it. The model gets blamed. The actual cause is two definitions that drifted apart.
Laravel 13.43 adds the fix from the schema side. JsonSchema::rules() turns an object schema into Laravel validation rules, so the same definition that tells the model what to send also checks what came back. It works with a fluent schema, a raw JSON Schema array like an MCP tool's input, or inside a form request's rules() method.
What I found most useful wasn't the feature, it was reading how it behaves. It returns Laravel rules, not a JSON Schema validator, so Laravel's behavior applies: a numeric string like "3" passes integer, and validation doesn't cast it, so your handler can still receive a string. A required array rejects an empty array, which JSON Schema would accept. A default in the schema adds no rule, so nothing fills it in. Only a handful of format values become rules.
And then the bigger point: even a perfect rule set only checks shape. A valid UUID doesn't mean the record exists or belongs to this user. The tool still runs with the user's authority, so ownership, policies, and business rules still live in your handler.
My advice: keep one definition, derive the rules, then write a small table of the awkward inputs a model actually sends and run it against your real rules. The table tells you what your version does instead of what you assume.
Full breakdown in comments.
PHP 8.6 is out.
But if you're running Laravel in production, I wouldn't start by asking:
"What new PHP features can I use?"
I'd ask:
"Can I upgrade without discovering problems in production?"
Check:
→ Composer dependencies
→ PHP extensions
→ queue workers
→ CI/CD
→ Docker images
→ long-running processes
→ application tests
The upgrade isn't the hard part.
Knowing your application is ready is.
#PHP #Laravel
One thing the PHP2Shell incident should make developers think about:
AI doesn't only make developers faster.
It can make vulnerability research faster too.
A vulnerability that existed for years can become much more dangerous when AI lowers the expertise and time required to understand and exploit it.
We're entering an era where:
AI-assisted development
and
AI-assisted security research
are advancing together.
That's going to change how quickly teams need to patch.
#PHP #AI #Security
Read replicas create a problem that's easy to miss:
Your write succeeds.
Your next read succeeds.
Your application is still wrong.
Why?
The replica hasn't caught up yet.
Laravel 13.40's replica commit IDs are a much more precise way to handle this than simply saying:
"Use the primary for two seconds."
Distributed systems need to reason about state, not guesses about time.
#Laravel #PHP #Database
The interesting part of Laravel AI SDK 1.4 isn't that agents can call tools.
It's what happens when the tool fails.
The SDK can now return the tool failure to the model instead of immediately killing the entire run.
That's closer to how real systems work.
APIs fail.
Permissions change.
Data becomes invalid.
A production agent needs a failure strategy, not just a happy path.
#Laravel #AI #PHP
A migration failure shouldn't just be:
"Migration failed."
In Laravel 13.42, migration failure events make it possible to react to failed migrations programmatically.
That's useful because deployment failures are operational events.
You may want to:
→ alert
→ log additional context
→ notify a deployment system
→ trigger observability workflows
The best frameworks don't just help you write code.
They help you operate it.
#Laravel #PHP #DevOps
We're moving from:
"Can an AI agent call a tool?"
to:
"What happens when the tool fails?"
That's a much more interesting engineering problem.
An agent in production needs to handle:
→ timeouts
→ invalid arguments
→ authorization failures
→ rate limits
→ partial results
→ retries
The impressive demo is the happy path.
The real product is the failure path.
#AI #Laravel #SoftwareEngineering
One AI-agent behavior I think will become essential:
Recovery.
Laravel AI SDK 1.4 can send a tool exception back to the model instead of immediately ending the agent run.
That's a much better mental model.
Real systems fail.
APIs timeout.
Tools reject input.
Databases return errors.
A production agent shouldn't assume everything succeeds.
It should know how to fail, reason, and try again safely.
#Laravel #AI #PHP
Laravel Herd 2 is interesting for a reason beyond "new features."
Local development is becoming part of the developer experience battle.
Coding agents.
Workspaces.
Cloud deployments.
Local PHP tooling.
The better these pieces work together, the less time developers spend fighting their environment.
A productive Laravel stack should make the path:
idea → code → test → deploy
feel boring.
Boring is good.
#Laravel #PHP #DeveloperExperience
Composer 2.11 introduced something I think more PHP teams should pay attention to:
A dependency cooldown policy.
You can tell Composer:
"Don't install a package version immediately after it's published."
That creates a deliberate delay between release and adoption.
For critical production applications, this is an interesting supply-chain defense.
Latest isn't always safest.
Sometimes waiting is the security feature.
#PHP #Composer #Laravel #Security
AI coding agents are moving into the IDE.
PhpStorm 2026.3 now includes an Agent Workspace alongside PHP 8.6 support and new Laravel inspections.
The interesting part isn't that agents can write code.
It's that the IDE can now help agents:
→ understand the project
→ inspect their changes
→ catch Laravel-specific problems
→ work inside a controlled development environment
The IDE is becoming an agent workspace.
That's a much bigger shift.
#PHP #Laravel #AI
Running Laravel's scheduler on multiple servers creates a simple question:
"What stops this job from running twice?"
Laravel now has Schedule::alwaysOnOneServer() for applications where scheduled tasks should execute on only one server.
This is the kind of production detail you don't think about on localhost.
Then you add a second server.
And suddenly architecture matters.
Scaling isn't just adding machines.
It's understanding what happens when everything runs twice.
#Laravel #PHP #DistributedSystems
One Laravel 13 change I really like:
Queue workers can now express their memory limit as a percentage.
Instead of:
--memory=512
You can use:
--memory=60%
That's a small operational improvement, but it solves a real deployment problem.
The same worker configuration can behave sensibly across machines with different PHP memory limits.
Good tooling adapts to the environment.
#Laravel #PHP #Queues
PHP 8.6 is getting very close.
RC4 is already available for testing, with the final release planned for November 19.
This is the point where I'd want every serious PHP team asking:
Have we tested our application?
Not just the code.
Packages.
Extensions.
CI.
Docker images.
Workers.
Deployment.
Production configuration.
"The new PHP version broke something" shouldn't be discovered on release day.
#PHP #Laravel #PHP86
There's a category of bug where the vulnerable line looks like the most harmless code in the file.
Imagine a developer adds a progress message inside a task running under Concurrency::run(), so the logs show what each task is doing. The message includes the search term the user typed. It's a log line. It gets approved in thirty seconds.
What the Laravel 13.40 release notes describe is why that line matters. Under the default process driver, each task runs in a child PHP process, and the result travels back to the parent over the child's standard output. The task's own output shares that stream. The parent read the output and unserialized the result envelope. A task that printed user-controlled text could therefore write a fake result, and the parent would unserialize it. The pull request that fixed it describes this as a potential unauthenticated remote code execution, and demonstrates a gadget chain in its tests.
Until the fix, the only defenses were disabling the process driver or auditing every task for anything that writes to stdout. The second one is harder than it sounds, because "writes to stdout" includes code you call, not just code you wrote.
13.40 signs the result with a random key the parent creates for each task and ignores any frame that doesn't verify.
The part I'd stress isn't the patch, it's the rollout. The parent that does the unserializing can be a queue worker or an Octane worker, and those keep running the old framework code in memory until they're restarted. A deploy without queue:restart or octane:reload hasn't fixed anything on those processes.
I couldn't find a CVE or advisory for this, and the fix is labeled 13.x only. On 12.x or 11.x, the status is unknown, so the safe reading is to mitigate and watch the release notes.
Full breakdown in comments, including a four-step exposure check.
@oderajoseph Yes due to network delay this most often bug arise. However, following ACID (atomicity, consistency, Integrity, dependency) law while managing api is the Best solution
There's a bug report that's almost impossible to reproduce on a developer laptop, and it's about to be filed against a lot of apps.
"I saved my changes and they disappeared." Then, ten seconds later: "never mind, they're back."
The cause isn't the application code. The write succeeded. The page the user reloaded was served by a read replica that hadn't applied the change yet. On a laptop with one database, the delay between write and read doesn't exist. In production, with replication lag that averages under a second and occasionally spikes to fifteen, it's long enough for a user to doubt your app.
Laravel 13.38 added tools for this. A PreventStaleDatabaseReads middleware records a timestamp in the session after a write, and for the next two seconds by default, that user's reads go to the primary instead. A new usingWritePdo() method does the same for a single block of code, including relations loaded inside it, which the older onWriteConnection() didn't.
What I found most useful wasn't the feature. It was reading where its edges are. It only protects the user who wrote. It only tracks the default connection. It depends on the session, so stateless APIs are outside it. And the window has to be longer than your worst lag, because a window that closes early gives users the new value, then the old one again, then the new one.
One independent test with a deliberately delayed replica went further, reporting that route model binding can load the model before the middleware switches connections, that queued jobs can still read the replica, and that the database cache store can let a rate limiter be outrun. Those are worth treating as things to check, not facts to assume.
The cheapest way to find out for your own app: run a replica with a five second delay on your laptop and click through your own app before your users do.
Full breakdown in comments.