Skip to content

Commit 908f541

Browse files
committed
#190: Fix merged words in json-api output to snake_cased types
1 parent 05d74ca commit 908f541

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Helpers/Json.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function getResource(BaseFormRequest $formRequest, $model, string $entity
125125
{
126126
$transformer = new DefaultTransformer($formRequest);
127127
if ($this->isCollection === true) {
128-
$collection = new Collection($model, $transformer, strtolower($entity));
128+
$collection = new Collection($model, $transformer, MigrationsHelper::getTableName($entity));
129129
if (empty($this->meta) === false) {
130130
$collection->setMeta($this->meta);
131131
}
@@ -137,7 +137,7 @@ public function getResource(BaseFormRequest $formRequest, $model, string $entity
137137
return $collection;
138138
}
139139

140-
$item = new Item($model, $transformer, strtolower($entity));
140+
$item = new Item($model, $transformer, MigrationsHelper::getTableName($entity));
141141
$item->setMeta($this->meta);
142142

143143
return $item;

0 commit comments

Comments
 (0)