Laravel Pro Tips
#eloquent #collections #null
π‘ #Laravel Tips of the day π ππΌπ»βπ ππΆπΉππ²πΏ π―π π‘π¨ππ πΆπ» ππΌπΉπΉπ²π°ππΆπΌπ»π: We can filter by NULL in Eloquent, but if we're filtering the collection further - filter by empty string, there's no "null" in that field anymore. #php #backend
vigowebs
#eloquent #sorting
π₯ #Laravel Tip: Make use of βorderByRawβ when you need to sort records in a more complex manner than simply A-Z or Z-A. Hereβs an example where I sort βrolesβ based on their level of importance (rather than their alphabetical order).
Matt Kingshott
#cheatsheet #DB
πA #Laravel DB Cheatsheet Part 1/5 π₯π₯ #PHP πPart 2 coming tomorrow π
Aaron Lumsden π | Indie Hacker Dev
#eloquent #database #aggregates
π₯ #Laravel Tip: Hereβs a simple, but important oneβ¦ particularly if youβre new to the framework. Make sure that aggregations are done within the DB and not Laravel. Go even further with indexes and WHERE constraints:
#gates #cheatsheet
π A #Laravel Gate #cheatsheet #PHP π₯β‘οΈ
#files #cheatsheet
π #Laravel File #cheatsheet #php π₯π₯ β‘οΈAre there any of these methods that you weren't aware of?
#eager loading #performance #lazy loading
πIf performance is the #1 priority in your project you might want to disable lazy loading completely. Eloquent will throw a huge exception in your face if a relation is not eager-loaded and you try to access it. Just use this snippet:
Martin Joo
#authentication #cheatsheet
πA #Laravel Auth #cheatsheet π₯π₯ #PHP
#routes
π₯ #Laravel Tip: Make use of signed and temporary signed routes to prevent people modifying important urls / links.