dingo / dingo/api

ResourceRegistrar is incorrectly registered as singleton

Open
#1,291 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Reusing ResourceRegistrar will lead to mishandling of parameter names, for example:
```PHP
$api->resource('users', ['parameters' => ['users' => 'id']]);
$api->resource('posts', ['parameters' => ['posts' => 'id']] /* ignored */);
```

The second route is incorrectly registered. Binding ResourceRegistrar in the provider as non-singleton solves this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.