Skip to content

Commit 1ed618b

Browse files
dacercoolexDavid Cedeño
andauthored
[Bugfix] Allow zero as a resource id (#179)
Co-authored-by: David Cedeño <[email protected]>
1 parent f54f62a commit 1ed618b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Routing/Route.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ public function modelOrResourceId()
9999
throw new LogicException('No JSON API resource id name set on route.');
100100
}
101101

102-
if ($modelOrResourceId = $this->route->parameter($name)) {
102+
$modelOrResourceId = $this->route->parameter($name);
103+
104+
if (!empty($modelOrResourceId) || '0' === $modelOrResourceId) {
103105
return $modelOrResourceId;
104106
}
105107

0 commit comments

Comments
 (0)