This repository was archived by the owner on Jun 27, 2024. It is now read-only.
File tree 2 files changed +18
-12
lines changed
2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -3,31 +3,39 @@ export default {
3
3
props: {
4
4
meta: {
5
5
type: Object ,
6
- default : () => {},
6
+ default : () => {
7
+ return {};
8
+ },
7
9
required: false ,
8
10
},
9
11
10
12
columns: {
11
13
type: Object ,
12
- default : () => {},
14
+ default : () => {
15
+ return {};
16
+ },
13
17
required: false ,
14
18
},
15
19
16
20
filters: {
17
21
type: Object ,
18
- default : () => {},
22
+ default : () => {
23
+ return {};
24
+ },
19
25
required: false ,
20
26
},
21
27
22
28
search: {
23
29
type: Object ,
24
- default : () => {},
30
+ default : () => {
31
+ return {};
32
+ },
25
33
required: false ,
26
34
},
27
35
28
36
onUpdate: {
29
37
type: Function ,
30
- required: true ,
38
+ required: false ,
31
39
},
32
40
},
33
41
@@ -96,7 +104,9 @@ export default {
96
104
queryBuilderData: {
97
105
deep: true ,
98
106
handler () {
99
- this .onUpdate (this .queryBuilderData );
107
+ if (this .onUpdate ) {
108
+ this .onUpdate (this .queryBuilderData );
109
+ }
100
110
},
101
111
},
102
112
},
Original file line number Diff line number Diff line change @@ -10,17 +10,13 @@ class InertiaTableServiceProvider extends ServiceProvider
10
10
public function boot ()
11
11
{
12
12
Response::macro ('table ' , function (callable $ withTableBuilder = null ) {
13
- $ request = request ();
14
-
15
- $ response = $ this ;
13
+ $ tableBuilder = new InertiaTable (request ());
16
14
17
15
if ($ withTableBuilder ) {
18
- $ tableBuilder = new InertiaTable ($ request );
19
16
$ withTableBuilder ($ tableBuilder );
20
- $ tableBuilder ->applyTo ($ response );
21
17
}
22
18
23
- return $ response ;
19
+ return $ tableBuilder -> applyTo ( $ this ) ;
24
20
});
25
21
}
26
22
}
You can’t perform that action at this time.
0 commit comments