Skip to content
Back to skills

Upgrade To Laravel 13

ASecurity

Upgrade an app from Laravel 12.x to 13.x safely; PHP 8.3 baseline, dependency bumps, breaking-change checklist, and verification steps

  • 147 stars
  • 0 votes
  • 1 copy
  • 7 views
  • Added September 6, 2026
code-qualityphpsqlapi

Works with

  • api

Security analysis

A100/100

Scanned September 6, 2026

npx -y skills add jpcaparas/superpowers-laravel --skill upgrade-to-laravel-13 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Upgrade To Laravel 13?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Upgrade To Laravel 13
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpcaparas-upgrade-to-laravel-13/badge)](https://www.skillsdirectory.com/skills/jpcaparas-upgrade-to-laravel-13)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laravel:upgrade-13
description: Upgrade an app from Laravel 12.x to 13.x safely; PHP 8.3 baseline, dependency bumps, breaking-change checklist, and verification steps
---

# Upgrading to Laravel 13

Laravel 13 (released March 2026) is a deliberately small upgrade. Work through this checklist in a dedicated branch with green tests before and after.

## Prerequisites

- PHP 8.3+ (13.x supports PHP 8.3–8.5; 8.2 is dropped)
- Green test suite on 12.x before starting

## Commands

```
# Bump core dependencies in composer.json
"laravel/framework": "^13.0",
"laravel/tinker": "^3.0",
"phpunit/phpunit": "^12.0",
"pestphp/pest": "^4.0"

sail composer update                 # or: composer update

# Verify
sail artisan about                   # or: php artisan about
sail artisan test --parallel         # or: php artisan test --parallel
```

## Breaking-Change Checklist

High impact:
- Replace `VerifyCsrfToken` references with `PreventRequestForgery` (old name is a deprecated alias) — see `laravel:request-forgery-protection`
- PHP 8.3 minimum; upgrade PHP before `composer update`

Medium impact:
- `config/cache.php` gains `serializable_classes` (default `false`); allow-list any classes you store in cache as objects
- `upsert()` now throws `InvalidArgumentException` on empty `uniqueBy` — fix call sites instead of relying on invalid SQL
- Default cache prefixes / session cookie names switched underscores → hyphens; pin `CACHE_PREFIX`, `REDIS_PREFIX`, `SESSION_COOKIE` in `.env` if you relied on framework defaults (avoids logging everyone out and cold caches)

Low impact (scan if applicable):
- Serialized Eloquent collections now restore eager-loaded relations (affects queued jobs)
- `JobAttempted` event: `$exceptionOccurred` (bool) → `$exception` (`?Throwable`); `QueueBusy`: `$connection` → `$connectionName`
- Domain routes now take precedence over non-domain routes during matching
- MySQL `DELETE` with JOIN now compiles `ORDER BY`/`LIMIT` instead of silently dropping them
- Custom cache stores need `touch()`; custom queue drivers need size-inspection methods

## Patterns

- Upgrade one major version at a time; never skip 12.x → 13.x steps
- Read the full upgrade guide: https://laravel.com/docs/13.x/upgrade
- Laravel Boost ^2.0 offers an AI-assisted `/upgrade-laravel-v13` flow — useful, but review its diff like any PR
- Adopt new 13.x features (attributes, JSON:API resources, AI SDK) in follow-up PRs, not the upgrade PR

## Verification

- Full test suite + static analysis (PHPStan) clean
- Boot the app; verify sessions persist and caches warm correctly (prefix changes)
- Exercise queues, scheduler, and webhooks in staging before production

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.