This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Description
I propose we introduce proxies for when on collections and the query builder.
Example use cases:
- Collection sorting:
$collection->when($field)->sortBy($field)
- Database filtering:
User::when($coreDataOnly)->select(['name', 'email'])->get()
Working principle:
- if the value is true, then the called method is called on the target object and the result is returned
- if the value is false, then the called method is skipped and the target is returned