Laravel Community Tools by Tighten

Tag "5.8" tricks

3 tricks
If you only need the functionality of a custom rule once throughout your application, you may use a Closure instead of a rule object. The Closure receives the attribute's name, the attribute's value, and a $fail callback that should be called if validation fails. Below is the code example:
asifzcpe 5 years ago 21052
for software different features and set Feature On/Off
saeedvir 6 years ago 10200
If you want to count the number of results from a relationship without actually loading them you may use the "withCount" method, which will place a "{relation}_count" column on your resulting models.
kupendra 6 years ago 12026