From 999ad17684af282158f0900336e463492f2a9b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alfaiate?= Date: Thu, 3 Apr 2025 12:41:25 +0700 Subject: [PATCH 1/2] fix: custom ajax action --- src/Services/DataTable.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Services/DataTable.php b/src/Services/DataTable.php index 9fd471a..64b1a3e 100644 --- a/src/Services/DataTable.php +++ b/src/Services/DataTable.php @@ -172,10 +172,6 @@ public function __construct() */ public function render(?string $view = null, array $data = [], array $mergeData = []) { - if ($this->request()->ajax() && $this->request()->wantsJson()) { - return app()->call($this->ajax(...)); - } - /** @var string $action */ $action = $this->request()->get('action'); $actionMethod = $action === 'print' ? 'printPreview' : $action; @@ -187,6 +183,10 @@ public function render(?string $view = null, array $data = [], array $mergeData return app()->call($callback); } + if ($this->request()->ajax() && $this->request()->wantsJson()) { + return app()->call($this->ajax(...)); + } + /** @phpstan-ignore-next-line */ return view($view, $data, $mergeData)->with($this->dataTableVariable, $this->getHtmlBuilder()); } From 205653ab2c6498d0496dcbb661650b8975ecb55a Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Mon, 7 Apr 2025 23:02:59 +0800 Subject: [PATCH 2/2] chore: release v12.1.3 :rocket: --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1b3da5..954868c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Laravel DataTables Buttons Plugin CHANGELOG. +## v12.1.3 - 2025-04-07 + +- fix: custom ajax action #197 + ## v12.1.2 - 2025-03-18 - fix: stubs with generics #196