@@ -193,14 +193,14 @@ public function __construct()
193
193
/**
194
194
* Process dataTables needed render output.
195
195
*
196
- * @phpstan-param view-string $view
196
+ * @phpstan-param view-string|null $view
197
197
*
198
- * @param string $view
198
+ * @param string|null $view
199
199
* @param array $data
200
200
* @param array $mergeData
201
201
* @return mixed
202
202
*/
203
- public function render (string $ view , array $ data = [], array $ mergeData = [])
203
+ public function render (string $ view = null , array $ data = [], array $ mergeData = [])
204
204
{
205
205
if ($ this ->request ()->ajax () && $ this ->request ()->wantsJson ()) {
206
206
return app ()->call ([$ this , 'ajax ' ]);
@@ -209,13 +209,15 @@ public function render(string $view, array $data = [], array $mergeData = [])
209
209
/** @var string $action */
210
210
$ action = $ this ->request ()->get ('action ' );
211
211
212
- if (in_array ($ action , $ this ->actions )) {
213
- if ($ action == 'print ' ) {
214
- return app ()->call ([$ this , 'printPreview ' ]);
215
- }
212
+ if ($ action == 'print ' ) {
213
+ $ action = 'printPreview ' ;
214
+ }
216
215
217
- // @phpstan-ignore-next-line
218
- return app ()->call ([$ this , $ action ]);
216
+ if (in_array ($ action , $ this ->actions ) && method_exists ($ this , $ action )) {
217
+ /** @var callable $callback */
218
+ $ callback = [$ this , $ action ];
219
+
220
+ return app ()->call ($ callback );
219
221
}
220
222
221
223
return view ($ view , $ data , $ mergeData )->with ($ this ->dataTableVariable , $ this ->getHtmlBuilder ());
0 commit comments