Repository navigation
[9.x] add findOr method to Query/Builder - #42290
Conversation
|
Another way of doing this is by using the the |
|
No support because you can do the same thing with plain PHP: vs (also the |
|
I'm 👎 here, for the reason provided by @bert-w. Since PHP 8.0, throw statements are also expressions. |
|
And yet none of you had problems with #42092, when the usage with throwing an exception was highlighted? |
good catch, didnt see that PR since I only browse here occasionally. However that being said I'd take the same stance. Any of the Anyway that means that this function is already merged so RIP |
True. Would say more, but this isn't the community for being able to take constructive criticism. |
|
Apparently there's also #42253 , no clue why these all pop up around the same time. It is kinda weird especially since Laravel 9.x now requires PHP 8+ which adds nice functionality to the language itself. I think it will take a couple of years (yes) for people to start using features frequently like the null safe ( |
* add findOr method to Query/Builder * fixing code style Co-authored-by: Mihai Leu <mihai.leu@emag.ro>
This PR adds a findOr() method to the Query Builder. It is similar with #42092
Example usage:
Edit: I updated the example as it was wrong.
Probably there are other usage cases.