inertia-laravel
inertia-laravel copied to clipboard
[2.x] Ensure closures are resolved via App in resolveArrayableProperties
This PR resolves a regression in 2.x where shared data closures with arguments could not be resolved. This patch ensures that the closures are resolved using App::call()
.
e.g.,
Inertia::share('query', fn (Request $request) => $request->query());
I encountered this while trying to upgrade a project to Inertia 2.x. A supporting test has been created to demonstrate further.