Plenty of AI features ship inside ordinary Laravel apps: a chatbot endpoint here, an embeddings job there.
The Laravel 12 end of life arrives on February 24, 2027, when security fixes stop. If the application runs on PHP 8.2, the PHP 8.2 end of life for security support comes even sooner, on December 31, 2026.
I look at this as two separate maintenance decisions rather than one large migration. The PHP runtime needs attention, the framework needs attention, and the AI features need to keep working through both changes.
The objective is to keep the existing application supported without changing how it behaves, not to rebuild it around newer AI capabilities.
When does Laravel 12 security support end?
Laravel follows a published support policy that provides bug fixes for 18 months and security fixes for two years for each release.
According to the Laravel 13 release notes, Laravel 12 was released on February 24, 2025. Its bug-fix period ended on August 13, 2026, and its security-fix period ends on February 24, 2027.
Laravel 13 was released on March 17, 2026. Its bug-fix support runs until Q3 2027, with security fixes continuing until March 17, 2028.
The supported PHP versions also change:
- Laravel 12 supports PHP 8.2 through 8.5.
- Laravel 13 supports PHP 8.3 through 8.5.
- Laravel 11 security support already ended on March 12, 2026.
The end of security support does not mean an application stops running. It means the framework is outside its published security-fix window, which matters for an application that accepts customer messages, processes documents or gives AI agents access to business data.
Why would I upgrade PHP before Laravel?
The Laravel 13 PHP 8.3 minimum means an application running Laravel 12 on PHP 8.2 needs a runtime change before, or alongside, the framework upgrade.
There is another reason to address PHP first: its support deadline arrives earlier.
The official PHP supported versions schedule lists the following security-support deadlines:
- PHP 8.2: December 31, 2026.
- PHP 8.3: December 31, 2027.
- PHP 8.4: December 31, 2028.
- PHP 8.5: December 31, 2029.
PHP 8.4 receives active support until December 31, 2026, while PHP 8.5 receives active support until December 31, 2027.
My preferred approach is to upgrade PHP while keeping Laravel 12 in place, run the application’s full test suite, and then introduce Laravel 13.
This separates runtime compatibility problems from framework compatibility problems. When something behaves differently, there is a smaller set of changes to investigate.
I would also check which PHP runtime the web application, command-line processes, scheduled tasks and queue workers actually use. Changing the web runtime alone is not enough if background processes continue using the older environment.
The minimum PHP version is a compatibility requirement, not necessarily the best long-term choice; I would pick a supported version based on dependencies and the hosting environment.

Where do Laravel dependencies hide inside AI applications?
A common pattern: a business application has a conventional Laravel backend, an administrative dashboard and a customer-facing interface. AI functionality arrives gradually through a chatbot endpoint, queued model requests, scheduled embeddings and integrations with external tools.
Nobody may even call it an AI application, yet several AI workflows depend on the framework:
- Queue workers that send requests to model APIs and process responses.
- Webhook endpoints that receive chatbot messages or external events.
- Scheduled jobs that generate or refresh embeddings.
- Administrative panels where team members review generated content.
- Cached PHP objects stored through Redis-backed application caching.
- Application services that control which tools an agent can access.
I would map these dependencies before changing the runtime or framework.
An ordinary application test might confirm that a request returns successfully. An AI feature evaluation should also examine whether the response remains usable, whether tool calls follow the intended boundaries and whether background jobs complete as expected.
The framework upgrade should not become an accidental change to the application’s agent access and authorization boundaries.
Planning a framework or runtime upgrade for an application with AI features? Get in touch to discuss the application architecture, dependencies and migration approach.
Which Laravel 13 changes would I review first?
The official Laravel 13 upgrade guide separates changes by their expected impact. I would start with dependency requirements and then review the application behaviors most relevant to its architecture.
Composer dependencies
The guide identifies updates to the framework, Laravel Boost, Laravel Tinker and the testing dependencies.
The relevant Composer constraints are:
~~~json
“laravel/framework”: “^13.0”,
“laravel/boost”: “^2.0”,
“laravel/tinker”: “^3.0”,
“phpunit/phpunit”: “^12.0”,
“pestphp/pest”: “^4.0”
~~~
These are individual constraint lines, not a complete Composer file. I would update only the packages the application already uses.
Request forgery protection
The VerifyCsrfToken middleware has been renamed to PreventRequestForgery.
Laravel 13 also introduces request-origin verification using the Sec-Fetch-Site header. The previous VerifyCsrfToken and ValidateCsrfToken names remain available as deprecated aliases.
I would review custom middleware, browser-based AI interfaces and webhook route configuration. The goal is to confirm that legitimate requests continue working while preserving the intended request protections.
Cached PHP objects
The new cache serializable_classes option defaults to false. This hardens cache unserialization against gadget-chain attacks if the application’s APP_KEY is exposed.
Applications that intentionally cache PHP objects need to specify the classes they permit.
I would inspect cached application state, including any objects used by AI workflows, rather than broadly allowing arbitrary classes simply to preserve existing behavior.
Database upserts
On MySQL and MariaDB, an upsert operation with an empty uniqueBy argument now throws an InvalidArgumentException.
I would review ingestion jobs, synchronization routines and embedding-related persistence code that uses upserts.
Cache prefixes and session cookies
Framework-generated default cache prefixes, Redis key prefixes and session cookie names are now hyphenated.
Applications relying on the previous framework fallbacks can retain their existing behavior by explicitly setting CACHE_PREFIX, REDIS_PREFIX and SESSION_COOKIE.
I would establish the intended values before deployment. These settings deserve particular attention when existing workers, application instances and user sessions share infrastructure.

Does the Laravel AI SDK change my upgrade strategy?
Laravel 13 introduces a first-party Laravel AI SDK with a unified API for text generation, tool-calling agents, embeddings, audio, images and vector-store integrations.
The release also introduces semantic and vector search capabilities.
These are useful first-party primitives, but I would not make SDK adoption part of the Laravel 13 upgrade.
An existing application may already have model integrations, prompt management, tool definitions, embedding pipelines and application-specific evaluation methods. Replacing those components during a framework migration introduces another set of behavioral changes.
My approach would be to preserve the existing integrations first.
Once the framework upgrade is stable, I would evaluate the Laravel AI SDK against specific application requirements. A new integration could then be introduced behind a feature flag, with the existing implementation available while its behavior is evaluated.
The same goes for semantic search: a new framework capability alone is not a reason to replace an existing retrieval pipeline. Framework maintenance and AI architecture decisions should stay separate.
How would I upgrade Laravel 12 to 13?
I would start with a dedicated branch, a representative staging environment and a documented understanding of the application’s existing behavior.
The approach is similar to the runtime maintenance principles in my Node.js runtime upgrade notes: identify dependencies, isolate changes and validate the workloads that actually matter.
| Step | What Laravel or PHP says | What I add for AI features |
|---|---|---|
| Establish the baseline | Laravel and PHP publish separate support schedules. | Document AI endpoints, workers, scheduled jobs and existing evaluation cases. |
| Upgrade PHP | Laravel 13 requires PHP 8.3 or later. | Keep Laravel 12 in place and test model integrations and background processing. |
| Update the framework | Laravel 13 requires updated Composer dependencies. | Preserve existing prompts, model integrations and tool definitions. |
| Review compatibility | The upgrade guide identifies middleware, cache and upsert changes. | Inspect chatbot requests, cached AI state and ingestion jobs. |
| Validate staging | Apply the relevant framework migration guidance. | Re-run AI evaluations, scheduled embedding jobs and queue workloads. |
| Deploy | Retain previous cache and session naming where necessary through explicit configuration. | Coordinate worker restarts, monitor application behavior and maintain a rollback plan. |
For a Laravel Boost upgrade, Boost (Laravel’s first-party MCP server) provides an /upgrade-laravel-v13 slash command for supported AI coding assistants. I would use it to help find and apply changes, then review every modification against the official guide. Passing tests is useful evidence, but I also want to understand why each change was made.
My pre-deployment checklist
- Create an upgrade branch and staging copy.
- Record the PHP versions used by web and background processes.
- Upgrade PHP on Laravel 12 and run the full test suite.
- Update the Laravel 13 dependencies.
- Review request forgery middleware and webhook routes.
- Inspect cached objects and permitted serialization classes.
- Review MySQL or MariaDB upsert calls.
- Confirm cache prefixes, Redis prefixes and session cookie names.
- Re-run AI evaluations, queued model requests and embedding jobs.
- Prepare deployment, worker restart and rollback steps, and keep AI SDK adoption out of scope.
What can an upgrade guide not tell me about my application?
An official upgrade guide describes framework-level changes. Its assessment of a typical application is not an assessment of every application’s dependencies, integrations or operational requirements.
Third-party packages may lag behind framework releases. Hosting providers also maintain their own PHP availability and support timelines.
Neither can be determined from Laravel’s release schedule alone.
I would verify dependency compatibility and hosting support before committing to a deployment approach. I would also review whether a rollback could safely restore the previous application version alongside its database, cache and queued-job state.
For founders and small teams, the question is not whether Composer can install Laravel 13, but whether the whole application can move while keeping its business workflows intact.
That is where cloud and application infrastructure planning meets the engineering requirements of AI agents and automation.
Key takeaways
- PHP 8.2 security support ends December 31, 2026.
- Laravel 12 security fixes end February 24, 2027.
- Laravel 13 requires PHP 8.3 or later.
- Upgrade and validate the PHP runtime before changing the framework where practical.
- Review middleware, cached objects, upserts and framework-generated configuration defaults.
- Evaluate existing AI workflows before and after the migration.
- Treat Laravel AI SDK adoption as a separate architectural decision.
My recommendation is to keep the migration deliberately uneventful. Replace the underlying framework and runtime, preserve the application’s established behavior, and explore new AI capabilities after the maintenance work is complete.
If you are preparing an AI-enabled Laravel application for its next supported release, I am open to discussing the architecture and migration requirements.
I also write about these kinds of engineering decisions in Production Notes. Sign up for the newsletter for more field notes on application infrastructure, AI systems and the maintenance work behind them.
FAQ
When does Laravel 12 reach end of life?
Laravel 12 reaches the end of its security-support period on February 24, 2027. Its bug-fix support ended on August 13, 2026. Applications can continue running after the security deadline, but the framework will be outside its published security-fix window. Applications using PHP 8.2 also face an earlier runtime security-support deadline of December 31, 2026.
Does Laravel 13 require PHP 8.3?
Yes. Laravel 13 requires a minimum of PHP 8.3 and supports PHP versions through 8.5. Applications currently running PHP 8.2 must upgrade their runtime before or alongside the framework migration. I prefer upgrading PHP while retaining Laravel 12 initially, then validating the application before introducing the Laravel 13 framework changes.
What breaks when upgrading Laravel 12 to 13?
Not every application will encounter compatibility problems. Areas worth reviewing include Composer dependencies, renamed request forgery middleware, cached PHP object serialization, MySQL and MariaDB upserts with empty uniqueBy arguments, and framework-generated cache prefixes and session cookie names. Applications with AI features should additionally validate their queued jobs, webhook endpoints and existing model integrations.
Do I have to use the Laravel AI SDK after upgrading?
No. Upgrading to Laravel 13 does not require replacing existing AI integrations with the first-party Laravel AI SDK. I would keep working model integrations, embedding pipelines and tool-calling implementations in place during the framework migration. The SDK can be evaluated separately and introduced behind a feature flag when it addresses a specific application requirement.