221 lines
10 KiB
Markdown
221 lines
10 KiB
Markdown
# Upgrade Log: Goos — Laravel 11 → 12 + Full Ecosystem
|
|
|
|
> Date: 2026-02-10 / 2026-02-11
|
|
> Branch: `laravel-v12`
|
|
|
|
---
|
|
|
|
## Version Changes
|
|
|
|
### Composer (PHP)
|
|
|
|
| Package | Before | After | Notes |
|
|
|---------|--------|-------|-------|
|
|
| laravel/framework | 11.47.0 | 12.50.0 | |
|
|
| filament/filament | 3.3.45 | 5.2.1 | Via v4 rector then v5 rector |
|
|
| livewire/livewire | 3.x | 4.1.4 | |
|
|
| pestphp/pest | 2.x | 4.3.2 | PHPUnit 12 |
|
|
| barryvdh/laravel-debugbar | 3.x | 4.0.7 | |
|
|
| inertiajs/inertia-laravel | 1.3.3 | 2.1.0 | |
|
|
| jeffgreco13/filament-breezy | 2.6.4 | 3.1.1 | |
|
|
| ariaieboy/filament-currency | 1.13.0 | 3.0.0 | |
|
|
| amidesfahani/filament-tinyeditor | 3.0.0 | 4.0.5 | |
|
|
| ralphjsmit/laravel-filament-components | 2.2.0 | 3.1.0 | |
|
|
| mollie/laravel-mollie | 3.1.0 | 4.0.2 | |
|
|
| symfony/http-client | 7.x | 8.x | |
|
|
| symfony/mailgun-mailer | 7.x | 8.x | |
|
|
| laravel/sanctum | 3.x | 4.x | |
|
|
| nunomaduro/collision | 7.x | 8.x | |
|
|
| codezero/laravel-localized-routes | 4.0.1 | *removed* | Replaced |
|
|
| codezero/laravel-localizer | 3.0.0 | *removed* | Unused |
|
|
| opgginc/codezero-laravel-localized-routes | — | 5.x | Replacement fork |
|
|
| filament/spatie-laravel-translatable-plugin | 3.3.45 | *removed* | Deprecated in Filament v4 |
|
|
| lara-zeus/spatie-translatable | — | 2.x | Replacement |
|
|
| johncarter/filament-focal-point-picker | 3.1.0 | *removed* | No Filament v5 support |
|
|
| pestphp/pest-plugin-browser | — | 4.2 | New — browser testing |
|
|
|
|
### NPM (Frontend)
|
|
|
|
| Package | Before | After | Notes |
|
|
|---------|--------|-------|-------|
|
|
| tailwindcss | 3.3.2 | 4.1.18 | Manual migration |
|
|
| vite | 6.x | 7.3.1 | Required by laravel-vite-plugin v2 |
|
|
| @inertiajs/vue3 | 1.x | 2.x | |
|
|
| laravel-vite-plugin | 1.x | 2.x | |
|
|
| @vitejs/plugin-vue | 5.x | 6.x | |
|
|
| @vueuse/core | 10.x | 14.x | |
|
|
| vue-i18n | 9.x | 11.x | |
|
|
| swiper | 10.x | 12.x | |
|
|
| @gtm-support/vue-gtm | 2.x | 3.x | |
|
|
| autoprefixer | 10.x | *removed* | Not needed with TW v4 |
|
|
| @tailwindcss/forms | 0.5.x | *removed* | Built into TW v4 |
|
|
| @tailwindcss/typography | 0.5.x | *removed* | Built into TW v4 |
|
|
| @tailwindcss/aspect-ratio | 0.4.x | *removed* | Built into TW v4 |
|
|
| eslint-plugin-tailwindcss | 3.x | *removed* | No TW v4 support |
|
|
| @tailwindcss/postcss | — | 0.x | New — TW v4 PostCSS plugin |
|
|
| @tailwindcss/vite | — | 4.x | New — TW v4 Vite plugin |
|
|
| playwright | — | latest | New — browser testing |
|
|
|
|
---
|
|
|
|
## All Issues Encountered
|
|
|
|
### 1. codezero packages block Laravel 12
|
|
|
|
**Error:** `codezero/laravel-localized-routes ^4` and `codezero/laravel-localizer ^3` have no Laravel 12 support.
|
|
|
|
**Fix:**
|
|
- Replaced `codezero/laravel-localized-routes` with `opgginc/codezero-laravel-localized-routes ^5.0`
|
|
- Removed `codezero/laravel-localizer` entirely (unused — no PHP code references `CodeZero\Localizer`)
|
|
- Removed `codezero/composer-preload-files` from `allow-plugins` in `composer.json`
|
|
|
|
### 2. codezero/composer-preload-files plugin blocked Composer
|
|
|
|
**Error:** After removing from `allow-plugins`, the plugin still existed in vendor. Composer refused to run any command.
|
|
|
|
**Fix:** `composer config --no-plugins allow-plugins.codezero/composer-preload-files false`
|
|
|
|
### 3. Localized routes: `/en/` prefix no longer generated
|
|
|
|
**Error:** PageTest fails — redirects for English locale no longer have `/en/` prefix (e.g., `/ds` instead of `/en/ds`).
|
|
|
|
**Status:** Open. Needs investigation — may be a config difference in the opgginc v5 fork. The `config/localized-routes.php` has `omitted_locale => 'nl'`, so English should get prefixed.
|
|
|
|
**File:** `tests/Feature/Cms/Models/PageTest.php`
|
|
|
|
### 4. johncarter/filament-focal-point-picker incompatible with Filament v5
|
|
|
|
**Error:** Latest v4.1.0 and `dev-main` only support `filament/filament ^3.0|^4.0`.
|
|
|
|
**Fix:** Removed the package. Replaced `FocalPointPicker` with `TextInput` for focal point fields (stores coordinates as string like `"50% 50%"`).
|
|
|
|
**Files:**
|
|
- `cms/Filament/Form/Fieldset/ImageForBlock.php`
|
|
- `cms/Filament/Form/Fieldset/ImageVariantForBlock.php`
|
|
|
|
### 5. filament/spatie-laravel-translatable-plugin deprecated
|
|
|
|
**Error:** No v5 release. Package deprecated in Filament v4.
|
|
|
|
**Fix:** Replaced with `lara-zeus/spatie-translatable ^2.0` (recommended by Filament upgrade rector). Namespace changed from `Filament\SpatieLaravelTranslatablePlugin` → `LaraZeus\SpatieTranslatable\SpatieLaravelTranslatablePlugin` (handled by rector).
|
|
|
|
**File:** `app/Providers/Filament/AdminPanelProvider.php`
|
|
|
|
### 6. laravel-vite-plugin v2 requires Vite 7
|
|
|
|
**Error:** `npm install` fails — `laravel-vite-plugin ^2` has `peer vite@"^7.0.0"`.
|
|
|
|
**Fix:** Updated `vite` from `^6.2.0` to `^7.0.0` in `package.json`.
|
|
|
|
### 7. eslint-plugin-tailwindcss incompatible with Tailwind v4
|
|
|
|
**Error:** `npm install` fails — `eslint-plugin-tailwindcss ^3` requires `tailwindcss ^3.4.0`.
|
|
|
|
**Fix:** Removed from `devDependencies`. TW v4 ESLint plugin support does not exist yet.
|
|
|
|
### 8. Tailwind v3 → v4: manual migration required
|
|
|
|
**Error:** The automated `@tailwindcss/upgrade` tool fails with callback-based theme extensions, FormKit plugin, and `@apply` in `@layer base`.
|
|
|
|
**Fix:** Manual migration:
|
|
- `postcss.config.js` — replaced `tailwindcss + autoprefixer` with `@tailwindcss/postcss`
|
|
- `resources/css/app.css` — replaced `@tailwind` directives with `@import "tailwindcss"`, added `@theme {}` block with custom colors/fonts/spacing
|
|
- `resources/css/utility.css` — converted all `@layer base` classes using `@apply` to `@utility` blocks with plain CSS (including media queries for responsive values)
|
|
- Removed `tailwind.config.js` configuration (moved to CSS-first config)
|
|
- Removed plugins: `@tailwindcss/forms`, `@tailwindcss/typography`, `@tailwindcss/aspect-ratio`, `autoprefixer`
|
|
|
|
### 9. Inertia v2 SSR config change
|
|
|
|
**Error:** `@inertiajs/server` no longer exists in Inertia v2.
|
|
|
|
**Fix:** Changed `ssr.noExternal` from `['@inertiajs/server']` to `['@inertiajs/vue3']` in `vite.config.js`.
|
|
|
|
### 10. Filament v5: `Component::$container` uninitialized error
|
|
|
|
**Error:** `Typed property Filament\Schemas\Components\Component::$container must not be accessed before initialization` — thrown when calling `getChildComponents()` on Filament form components outside a Livewire context (during frontend page rendering via the CMS Block system).
|
|
|
|
**Root cause:** Filament v5's `getChildComponents()` creates a `Schema` wrapper that requires `getLivewire()`, which fails outside Filament admin panel context.
|
|
|
|
**Fix:** Replace `getChildComponents()` with `getDefaultChildComponents()` which returns raw component arrays without requiring a Schema/Livewire container.
|
|
|
|
**File:** `cms/Filament/Blocks/Block.php` — methods `getSchema()` and `hasSettings()`
|
|
|
|
### 11. Filament v5: `Field::make()` signature change
|
|
|
|
**Error:** `Declaration of DisplayText::make(string $name = ''): static must be compatible with Field::make(?string $name = null): static`
|
|
|
|
**Fix:** Changed `make(string $name = '')` to `make(?string $name = null)` and pass `$name ?? ''` to parent.
|
|
|
|
**File:** `app/Forms/Components/DisplayText.php`
|
|
|
|
### 12. PHPUnit 12 drops `@test` annotation support
|
|
|
|
**Error:** Tests using `/** @test */` are silently not discovered — `INFO No tests found.`
|
|
|
|
**Fix:** Replaced all `/** @test */` annotations with `#[PHPUnit\Framework\Attributes\Test]` attribute in all 7 test files. Added `use PHPUnit\Framework\Attributes\Test;` import to each.
|
|
|
|
**Files:**
|
|
- `tests/Feature/Cms/Models/PageTest.php`
|
|
- `tests/Feature/Cms/Models/RedirectTest.php`
|
|
- `tests/Feature/Models/UserTest.php`
|
|
- `tests/Feature/Services/Filament/HelperTest.php`
|
|
- `tests/Feature/Commerce/Actions/Order/CreateOrderFromCheckoutTest.php`
|
|
- `tests/Feature/Http/Controller/Public/FormControllerTest.php`
|
|
- `tests/Feature/Http/Controllers/Api/V0/AddressCheckControllerTest.php`
|
|
|
|
### 13. PHPUnit 12 / Pest v4: `setUp()` must be protected
|
|
|
|
**Error:** `Access level to Pest\Concerns\Testable::setUp() must be public (as in class Tests\TestCase)` — fatal error on any test run.
|
|
|
|
**Fix:** Changed `public function setUp(): void` to `protected function setUp(): void`.
|
|
|
|
**File:** `tests/TestCase.php`
|
|
|
|
### 14. Filament v5: `ViewAction` on ListRecords pages crashes
|
|
|
|
**Error:** `Resource::getViewAuthorizationResponse(): Argument #1 ($record) must be of type Model, null given` — thrown when rendering `ViewAction` header actions on list pages.
|
|
|
|
**Root cause:** In v5, `ViewAction` tries to authorize against a record, but list pages have no record (`null`).
|
|
|
|
**Fix:** Replace `ViewAction::make()` with `Action::make('name')` for navigation-only header actions that don't operate on a record.
|
|
|
|
**File:** `cms/Filament/Resources/BlogResource/Pages/ListBlogs.php`
|
|
|
|
### 15. Filament v4/v5 rector scripts
|
|
|
|
**Note:** Rector must run for EACH custom namespace directory separately: `app/`, `cms/`, `commerce/`, `modules/`, `support/`. No manual `$navigationGroup`/`$navigationIcon` type fixes needed in this project (uses method overrides).
|
|
|
|
**Files:** 112+ files modified by rector across all directories.
|
|
|
|
---
|
|
|
|
## Files Modified (manual changes only, excluding rector)
|
|
|
|
| File | Change |
|
|
|------|--------|
|
|
| `composer.json` | Version constraints, package replacements |
|
|
| `package.json` | Version constraints, removed TW plugins, cleanup |
|
|
| `postcss.config.js` | TW v4 PostCSS plugin |
|
|
| `resources/css/app.css` | TW v4 directives + `@theme` block |
|
|
| `resources/css/utility.css` | `@layer base` → `@utility` blocks |
|
|
| `vite.config.js` | SSR `noExternal` fix |
|
|
| `cms/Filament/Blocks/Block.php` | `getChildComponents()` → `getDefaultChildComponents()` |
|
|
| `cms/Filament/Form/Fieldset/ImageForBlock.php` | FocalPointPicker → TextInput |
|
|
| `cms/Filament/Form/Fieldset/ImageVariantForBlock.php` | FocalPointPicker → TextInput |
|
|
| `cms/Filament/Resources/BlogResource/Pages/ListBlogs.php` | ViewAction → Action |
|
|
| `app/Forms/Components/DisplayText.php` | `make()` signature fix |
|
|
| `tests/TestCase.php` | `setUp()` visibility |
|
|
| `tests/Pest.php` | Browser test suite binding |
|
|
| `phpunit.xml` | Browser test suite |
|
|
| `tests/Browser/PageTest.php` | New — browser smoke tests |
|
|
| `tests/Feature/**/*Test.php` (7 files) | `@test` → `#[Test]` attribute |
|
|
|
|
---
|
|
|
|
## Final State
|
|
|
|
- **Feature/Unit tests:** 15 passed, 1 failed (PageTest locale prefix — codezero fork issue)
|
|
- **Browser tests:** 4 passed (homepage, terms, contact, products)
|
|
- **Frontend build:** Clean (client + SSR), 0 npm vulnerabilities
|
|
- **169 files changed** total (including rector, vendor assets, lock files)
|