Back

Hey Laravel Developers

Did you know that when adding where conditionals in the Query Builder, you can use dynamic method names?

For example, if you want to fetch an order matching a particular quantity, you can call a dynamic method like whereQuantity($quantity) instead of using where('quantity', $quantity).

It just reads so much better! What do you think?

image

4

922

I personally avoid using the dynamic/magic/fluent methods. I cannot remember my reasoning 😂

1

86