This repository was archived by the owner on Jun 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -3,31 +3,39 @@ export default {
33 props: {
44 meta: {
55 type: Object ,
6- default : () => {},
6+ default : () => {
7+ return {};
8+ },
79 required: false ,
810 },
911
1012 columns: {
1113 type: Object ,
12- default : () => {},
14+ default : () => {
15+ return {};
16+ },
1317 required: false ,
1418 },
1519
1620 filters: {
1721 type: Object ,
18- default : () => {},
22+ default : () => {
23+ return {};
24+ },
1925 required: false ,
2026 },
2127
2228 search: {
2329 type: Object ,
24- default : () => {},
30+ default : () => {
31+ return {};
32+ },
2533 required: false ,
2634 },
2735
2836 onUpdate: {
2937 type: Function ,
30- required: true ,
38+ required: false ,
3139 },
3240 },
3341
@@ -96,7 +104,9 @@ export default {
96104 queryBuilderData: {
97105 deep: true ,
98106 handler () {
99- this .onUpdate (this .queryBuilderData );
107+ if (this .onUpdate ) {
108+ this .onUpdate (this .queryBuilderData );
109+ }
100110 },
101111 },
102112 },
Original file line number Diff line number Diff line change @@ -10,17 +10,13 @@ class InertiaTableServiceProvider extends ServiceProvider
1010 public function boot ()
1111 {
1212 Response::macro ('table ' , function (callable $ withTableBuilder = null ) {
13- $ request = request ();
14-
15- $ response = $ this ;
13+ $ tableBuilder = new InertiaTable (request ());
1614
1715 if ($ withTableBuilder ) {
18- $ tableBuilder = new InertiaTable ($ request );
1916 $ withTableBuilder ($ tableBuilder );
20- $ tableBuilder ->applyTo ($ response );
2117 }
2218
23- return $ response ;
19+ return $ tableBuilder -> applyTo ( $ this ) ;
2420 });
2521 }
2622}
You can’t perform that action at this time.
0 commit comments