← ClaudeAtlas

laravel-9-noteslisted

Laravel 9.x (February 2022) signature features and the breaking-change traps from 8 → 9. Use when writing or reviewing code in a Laravel 9 project, or in a package whose composer constraint includes ^9.0. Covers anonymous migrations, the Symfony 6 upgrade, Symfony Mailer replacing Swift Mailer, Flysystem 3 breaking changes (visibility / exception API), PHP 8.0 floor, query builder improvements, enum casts, and the new Ignition error page.
hmj1026/dhpk · ★ 1 · AI & Automation · score 72
Install: claude install-skill hmj1026/dhpk
# Laravel 9 — PHP 8 floor, Symfony 6, Flysystem 3 Released **February 2022** (Laravel skipped September 2021 to align with Symfony 6's release). PHP 8.0+ floor — the major PHP bump. --- ## Signature features ### Anonymous migrations ```php // database/migrations/2022_01_01_000000_add_status_to_orders.php return new class extends Migration { public function up(): void { Schema::table('orders', function (Blueprint $table) { $table->string('status')->default('pending'); }); } }; ``` **Why this matters**: pre-9.0 migrations were named classes (`AddStatusToOrders`). Re-running `make:migration` for the same column in a different version produced class-name collisions, especially when squashing schemas. Anonymous classes side-step the entire collision class. New migrations should use this form. Old named-class migrations still work; no need to rewrite them. ### Symfony Mailer (Swift Mailer removed) ```php // Same Mailable API as before Mail::to($user)->send(new OrderShipped($order)); ``` Underneath, Swift Mailer was replaced by Symfony Mailer. User-facing API is mostly identical, but **custom transports** must be reimplemented against `Symfony\Component\Mailer\Transport\TransportInterface`. ### Flysystem 3 (breaking changes) Storage facade still works, but underneath: - **Visibility constants** moved: `AdapterInterface::VISIBILITY_PUBLIC` → `Visibility::PUBLIC` - **Exceptions** changed: `FileNotFoundException` is gone; catch `