Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[9.x] Added callable support to operatorForWhere on Collection (#41414)
* [9.x] Added callable support to operatorForWhere on Collection Added `callable` support to `operatorForWhere`. Currently only Collection methods `where` and `whereFirst` are used without `callable` support. Adding callable to `operatorForWhere` allow complex usages as: ```php $city = $cities->firstWhere(fn ($city) => $city->state->available && ($city->state->id === $stateId)); ``` or ```php $state = $states->firstWhere(fn ($state) => (bool)$state->cities->firstWhere('id', $cityId)); ``` * Added callable test to `where` and `firstWhere` collection methods * Fixed firstWhere callable test typo
- Loading branch information