Skip to content

feat!: move to Laravel 12 and Sanctum 4 - #333

Merged
roncodes merged 9 commits into
release/v2.0.0from
feat/laravel-12
Nov 6, 2026
Merged

roncodes merged 9 commits into
release/v2.0.0from
feat/laravel-12

Conversation

@roncodes

@roncodes roncodes commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves core-api to Laravel 12, as 2.0.0, with illuminate/* ^12.69|^13.0, PHP ^8.2 and Sanctum 4. The wide range means the Laravel 13 step needs no constraint change here; hammerstone/fast-paginate still caps resolves at 12.

This branch stacks on three others, so its diff shrinks as they merge:

The last two aren't pushed yet. I merged their exact commits so their SHAs survive.

This branch's own changes

  • Dependencies: section 5 of the upgrade plan. Notification channels apn ^5.5, fcm ^5.1, twilio ^4.1, plus milon/barcode ^13, msgraph-mail ^2, fast-paginate ^2, the three fork majors, and Pest 3. Dev: cknow/laravel-money ^8, mockery ^1.6.
  • Bug fixed: FCM push. kreait/laravel-firebase 6 requires the config repository in FirebaseProjectManager's constructor. The old one-argument call in PushNotification would have failed every FCM push on Laravel 12. The spike only saw this as a harness error.
  • QueryOptimizer resolved its grammar with no connection (ArgumentCountError on Laravel 12) and only caught Exception. It now uses the connection's grammar and catches Throwable.
  • ReportQueryErrorHandler strips the host, port and database Laravel 11+ adds to QueryException messages. Otherwise a host or database name containing memory, timeout or permission decides the error category.
  • Alias removed: the array alias from fix(request): rename the array macro to inputArray #331 goes, since the native method shadows it on Laravel 12.
  • New guard test: ExpansionNativeCollisionTest fails if a native method ever shadows an expansion. Three already-shadowed ones with no dependants are listed in it.
  • Test harness: Encrypter and Filesystem fakes implement the new contract methods, and the money config path is set. loadMissing() gets a connection resolver, and the push tests get an application stand-in.

Testing

Local on PHP 8.2.28 against Laravel 12.70.2, Carbon 3.15.1 and the local fork branches:

Check Result
pest 2,410 passed, 0 failed (12 deprecated, 16 warnings, 1 risky)
Coverage, Homebrew PHP 8.3 with Xdebug Coverage threshold met: every enforced metric is at or above 100.00%, 0 uncovered statements
php-cs-fixer Applied: 2 files, style only

The same commit's predecessor on Laravel 10 had 2,375 passing, so all the new tests are accounted for. The Laravel 12 spike also booted the app under Octane and ran a fresh migrate and sandbox:migrate on MySQL with an earlier version of these changes; I haven't re-run those on this exact branch.

build: the forks are now tagged (laravel-mysql-spatial 2.0.0, countries 0.9.0, twilio 6.0.0), so build resolves from Packagist with no path or VCS repositories. The first run predates the tags and failed only on resolving them.

The Postman contract check is expected to stay red until the extensions and the root app are on Laravel 12. It boots fleetbase/fleetbase main's published Laravel 10 image and swaps this branch in with composer update fleetbase/core-api --with-all-dependencies. There, the root requires laravel/framework ^10, and the released extensions require core-api ^1.6.74 or *, so core-api 2.0.0 can't resolve, however this branch looks. That is not a fault in this PR, and the workflow is left unchanged. The plan is to run the contract against fleetbase/fleetbase#749 once core-api 2.0.0 and the extension Laravel 12 releases are available. The check isn't required by branch protection.

Merge and tag order

  1. feat!: support Laravel 12 and 13, drop Doctrine laravel-mysql-spatial#5 → tag v2.0.0
  2. feat!: drop pragmarx/coollection and require Illuminate collections countries#2 → tag v0.9.0
  3. feat!: require twilio/sdk ^8.3 for Laravel 12 laravel-twilio#2 → tag v6.0.0
  4. fix(request): rename the array macro to inputArray #331, then the two prep branches, into release/v2.0.0
  5. This PR. CI should go green after a re-run.

Not done here: the conflict entries for pre-port extension versions that the upgrade plan suggests. Those depend on the extension versions the extension PRs settle on.

Pins every diffIn* call as an explicit absolute or signed integer so results read the same on Carbon 2 and 3. Carbon 2 values are unchanged; tests pin direction and type at the priority sites.
…tion

List tables and indexes through the schema builder, which Laravel 10.37+ and 12
both provide. Replace the removed Schema::getAllTables() fallbacks and alias the
DataPurger catalog query, whose lower-case column name fails on MySQL 8.

Sanctum 4 stops loading its migrations, so add a create migration that sorts
after Sanctum 3's and before fix_personal_access_tokens. It is a no-op where the
table exists and on the sandbox database, which has never had it.
Requires illuminate ^12.69|^13.0, PHP ^8.2, Sanctum 4, Pest 3 and the matching
majors of the notification channels, barcode, msgraph-mail and fast-paginate, plus
the new majors of the spatial, countries and twilio forks.

Source fixes:
- PushNotification passes the config repository kreait/laravel-firebase 6 requires.
  Every FCM push would have failed on the old one-argument call.
- QueryOptimizer no longer constructs a Grammar with no connection, and catches
  Throwable so an Error here can't take the query down.
- ReportQueryErrorHandler ignores the host, port and database Laravel 11+ adds to
  QueryException messages, so an install's names can't decide the error category.

Test fixes: Encrypter and Filesystem fakes implement the new contract methods, the
money config path is set in the harness, and a guard test fails if a native method
ever shadows an expansion again.
The native Request::array() wins over it here, so it does nothing.
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/v2.0.0@93a7c33). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v2.0.0      #333   +/-   ##
==================================================
  Coverage                  ?   100.00%           
  Complexity                ?      9691           
==================================================
  Files                     ?       519           
  Lines                     ?     29812           
  Branches                  ?         0           
==================================================
  Hits                      ?     29812           
  Misses                    ?         0           
  Partials                  ?         0           
Flag Coverage Δ
backend 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…s/fast-paginate

The same 2.0.0 release under its new name. composer audit now reports nothing, not
even an abandoned package. Also raises phpspreadsheet to the patched 1.30.7.
@roncodes
roncodes merged commit 0975bcc into release/v2.0.0 Nov 6, 2026
4 of 5 checks passed
@roncodes
roncodes deleted the feat/laravel-12 branch November 6, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant