Skip to content

[7.x] Added support to use where in apiResource method#33790

Merged
taylorotwell merged 2 commits intolaravel:7.xfrom
Xfaider48:api-resource-where-support
Aug 10, 2020
Merged

[7.x] Added support to use where in apiResource method#33790
taylorotwell merged 2 commits intolaravel:7.xfrom
Xfaider48:api-resource-where-support

Conversation

@Xfaider48
Copy link
Contributor

This PR adds the possibility to use where option in apiResource method:

Route::apiResource('tests', TestController::class, [
   'where' => [
      'test' => '\d+'
   ]
]);

@taylorotwell
Copy link
Member

Do we allow this on normal calls to Route::resource?

@Xfaider48
Copy link
Contributor Author

Do we allow this on normal calls to Route::resource?

Yes, we do. I just added a wheres method to PendingResourceRegistration to control where option in resource (like other options) and added test for it.

@taylorotwell taylorotwell merged commit ba8af9e into laravel:7.x Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants