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 2
2
3
3
All notable changes to ` laravel-inertia-dataproviders ` will be documented in this file.
4
4
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
+
5
11
## v1.6.1 - 2024-06-21
6
12
7
13
* Attribute name formatting bugfix.
Original file line number Diff line number Diff line change 4
4
5
5
namespace Webfox \InertiaDataProviders ;
6
6
7
+ use Closure ;
7
8
use Illuminate \Contracts \Support \Arrayable ;
8
9
use Illuminate \Contracts \Support \Jsonable ;
9
10
use Inertia \LazyProp ;
@@ -41,7 +42,7 @@ public function toArray(): array
41
42
->filter (fn (ReflectionMethod $ method ) => ! $ method ->isStatic () && ! in_array ($ method ->name , $ this ->excludedMethods ))
42
43
->mapWithKeys (function (ReflectionMethod $ method ) {
43
44
$ 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]) ) {
45
46
return [$ method ->name => $ method ->invoke ($ this )];
46
47
}
47
48
You can’t perform that action at this time.
0 commit comments