Skip to content

fix(request): rename the array macro to inputArray - #331

Merged
roncodes merged 2 commits into
release/v2.0.0from
fix/request-input-array
Nov 6, 2026
Merged

roncodes merged 2 commits into
release/v2.0.0from
fix/request-input-array

Conversation

@roncodes

@roncodes roncodes commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Renames the Request::array() macro to inputArray(), with its 46 callers. array stays as a deprecated alias, so released extensions that still call it keep working on Laravel 10. Storefront's suite hit that through released fleetops. The Laravel 12 PR removes the alias, since the native method shadows it there anyway.

Laravel 11+ ships a native Request::array(). Native methods win over macros, so on Laravel 12 this macro silently stops running and nothing errors:

GET /int/v1/places?limit=5&sort=-created_at,name Result
Laravel 10 200
Laravel 12, without this rename 500 Unknown column 'created_at,name'

?without=a,b is affected the same way. With an empty table it looks fine, because pagination skips the sorted query.

The rename is safe on Laravel 10, so it can land before the upgrade. This has no behaviour change; the macro body is identical. As before, the macro takes one argument, so the second argument some callers pass ($request->array('from', [])) is still ignored. I left that alone.

Testing

composer test:unit on Laravel 10 at this commit: 2,375 passed, 14,701 assertions, the same as the untouched main commit.

The Laravel 12 failure was reproduced over HTTP in the upgrade spike, on both Octane and php -S. This branch has not itself been run on Laravel 12; that's the core-api Laravel 12 PR, which stacks on this one.

Merge order

Merge this first. These extension PRs call the new name and need a core-api release containing it:
fleetops, storefront, customer-portal, flespi, solid and pallet, all on branch fix/request-input-array.

Laravel 11+ ships a native Request::array(), and native methods win over macros,
so on Laravel 12 this macro silently stops running. `?sort=a,b` and `?without=a,b`
become a single value, and a sorted index returns a 500 for an unknown column.

Renaming it now is safe on Laravel 10 and keeps the comma splitting after the
upgrade. Callers and test harnesses follow the new name, with no behaviour change.
Released extensions still call the old name, and removing it breaks them against
a core-api with this change. Storefront's suite hit that through released fleetops.
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