File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to ` laravel-inertia-dataproviders ` will be documented in this file.
44
5+ ## v1.6.2 - 2024-09-20
6+
7+ * Closure serialization bugfix.
8+
9+ ** Full Changelog** : https://github.com/webfox/laravel-inertia-dataproviders/compare/v1.6.1...v1.6.2
10+
511## v1.6.1 - 2024-06-21
612
713* Attribute name formatting bugfix.
Original file line number Diff line number Diff line change 44
55namespace Webfox \InertiaDataProviders ;
66
7+ use Closure ;
78use Illuminate \Contracts \Support \Arrayable ;
89use Illuminate \Contracts \Support \Jsonable ;
910use Inertia \LazyProp ;
@@ -41,7 +42,7 @@ public function toArray(): array
4142 ->filter (fn (ReflectionMethod $ method ) => ! $ method ->isStatic () && ! in_array ($ method ->name , $ this ->excludedMethods ))
4243 ->mapWithKeys (function (ReflectionMethod $ method ) {
4344 $ returnType = $ method ->getReturnType ();
44- if ($ returnType instanceof ReflectionNamedType && $ returnType ->getName () === LazyProp::class) {
45+ if ($ returnType instanceof ReflectionNamedType && in_array ( $ returnType ->getName (), [ LazyProp::class, Closure::class]) ) {
4546 return [$ method ->name => $ method ->invoke ($ this )];
4647 }
4748
You can’t perform that action at this time.
0 commit comments