diff --git a/src/Requests/ActionRequest.php b/src/Requests/ActionRequest.php index 8f10b7a..f8ef971 100644 --- a/src/Requests/ActionRequest.php +++ b/src/Requests/ActionRequest.php @@ -35,10 +35,9 @@ public function models(): Collection $models = collect(); if ($this->has('_models')) { - $models = $this->model()->whereIn( - $this->model()->getKeyName(), + $models = $this->getModelQuery()->findMany( $this->get('_models') - )->get(); + ); } $current = $this->findModel(); diff --git a/src/ResourceRequest.php b/src/ResourceRequest.php index e288d1d..ab2f506 100644 --- a/src/ResourceRequest.php +++ b/src/ResourceRequest.php @@ -153,7 +153,7 @@ public function getModelPaginationList() /** * @return Model */ - private function getModelQuery() + protected function getModelQuery() { $query = $this->resource()->modelQuery($this, $this->model());