Laravel Pro Tips
#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
Aaron Lumsden 🎉 | Indie Hacker Dev
#routes
🔥 #Laravel Tip: Make use of signed and temporary signed routes to prevent people modifying important urls / links.
Matt Kingshott
#responses #cheatsheet
⚡️A Laravel Response #cheatsheet 🔥🔥 Some of the available methods on Laravel's response helper. 🤟 #laravel #php
#eloquent #models #relationships
🌶️ #Laravel Tip: The Eloquent push() method allows you to save the Model and all of its relations in one shot. Compared to the save() that only saves the Model itself. Here's a practical example to illustrate 🔥 https://t.co/N6q2wyDrya #PHP #Laravel
Bilal Haidar - Available 4 Laravel gigs
#joins #collections
You've probably joined an array into a comma separated string before. But what about when you want the last one to say "and"? With Laravel collections it's a breeze 🍃
Daniel Eckermann
#models #factories
🔥 Laravel Tip: Factory states You can create factory states in your model factories to hide the details about the model attributes and make your tests more readable.
Cosme Escobedo
#cheatsheet #config
👉 A #laravel Config #CheatSheet 🚀 The great thing about Laravel is the documentation is in the method names. 🤟
#collections
#Laravel Tip: If you have a collection, and you want to get items from the end of it, you may pass a negative integer to `take()` method to take the specified number of items from the end: Here is an example:
Oussama Sid