Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix props that extends Responsable after closures / lazy props #722

Merged
merged 0 commits into from
Apr 10, 2025

Conversation

d8vjork
Copy link
Contributor

@d8vjork d8vjork commented Mar 11, 2025

In a customer app we use a lot the Laravel Apiable package I was using on Inertia v1 and it worked until we upgraded to Laravel 12 and Inertia v2.

This fixes the problem as Apiable returns a Responsable that was serialised before on Inertia v1 whenever is a lazy prop or not.

It wasn't happening before as it run first the Closure check here:

if ($value instanceof Closure) {

Then the Arrayable check here converts the result from the Closure to an array:

if ($value instanceof Arrayable) {

Now this is separated into 2 blocks breaking this functionality.

@joetannenbaum joetannenbaum merged commit 3b40127 into inertiajs:2.x Apr 10, 2025
3 of 18 checks passed
@joetannenbaum
Copy link
Contributor

Thank you!

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.

2 participants