Skip to content

Commit

Permalink
Merge pull request #48 from CristalTeam/hotfix/lowercased_endpoint
Browse files Browse the repository at this point in the history
Fix endpoint transformed to lowercase
  • Loading branch information
ffouchier authored Apr 24, 2023
2 parents 17119f7 + a8aed90 commit 278ea26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public function __call($name, $arguments)

preg_match('/^(get|create|update|delete)([\w\-_\/]+?)$/', $name, $matches);

$endpoint = strtolower($matches[2]);
$endpoint = lcfirst($matches[2]);

if ('get' === $matches[1]) {
if (array_key_exists(0, $arguments) && !is_array($arguments[0])) {
return $this->findOne($endpoint, ...$arguments);
Expand Down

0 comments on commit 278ea26

Please sign in to comment.