validate([ 'page' => ['nullable', 'integer', 'min:1'], 'limit' => ['nullable', 'integer', 'min:1'] ]); $page = request()->input('page', 1); $limit = request()->input('limit', 10); $list = GameplayRule::forPage($page, $limit) ->orderBy('groups') ->orderByDesc('created_at') ->get(); } catch (ValidationException $e) { return $this->error($e->validator->errors()->first()); } catch (Exception $e) { return $this->error($e->getMessage()); } return $this->success($list); } }