From 31026616ab774b0f7a0889bcb8e074657d87d433 Mon Sep 17 00:00:00 2001 From: Emerson Carvalho Date: Sun, 7 Jan 2024 09:43:09 -0300 Subject: [PATCH] Improve the config name. --- config/query-builder.php | 2 +- src/Concerns/AddsFieldsToQuery.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/query-builder.php b/config/query-builder.php index 9216bfce..6dc6333d 100644 --- a/config/query-builder.php +++ b/config/query-builder.php @@ -48,5 +48,5 @@ * By default, the package convert the relationship names to snake case plural when using fields[relationship]. * Set this to false if you don't want that and keep the relationship names. */ - 'convert_to_snake_case_plural' => true, + 'convert_relation_names_to_snake_case_plural' => true, ]; diff --git a/src/Concerns/AddsFieldsToQuery.php b/src/Concerns/AddsFieldsToQuery.php index f97c1f0e..71b26f58 100644 --- a/src/Concerns/AddsFieldsToQuery.php +++ b/src/Concerns/AddsFieldsToQuery.php @@ -51,7 +51,7 @@ protected function addRequestedModelFieldsToQuery() public function getRequestedFieldsForRelatedTable(string $relation): array { - $tableOrRelation = config('query-builder.convert_to_snake_case_plural', true) + $tableOrRelation = config('query-builder.convert_relation_names_to_snake_case_plural', true) ? Str::plural(Str::snake($relation)) : $relation;