Laravel Pro Tips
#http #macros
💡 You can define HTTP macro to configure common request paths and headers when interacting with services throughout your application. #laravel #laravelphp #laraveltips #laraveltricks #laravelupdates #laravelfeatures
Laravel Updates | Tips and Tricks
#eloquent #debugging
TIL, in Laravel you can display debug information about the current query with dump() and dd() 🤙 This allows you to see the underlying query and bindings.
Daniel Eckermann
#validation #requests
🔥 #Laravel Tip: Sometimes you want to validate part of the request's data, but you don't actually need the data (and must make a point of filtering it out) e.g. a bool confirming the user accepts terms and conditions. In these situations, use the 'exclude' validation rule.
Matt Kingshott
#database
🔥 #Laravel Tip: Instructing the database to delete a huge number of records is likely to make it fall over (esp. when using cascade deletion). However, you can avoid this by staggering the process into batches and adding pauses to allow the database time to catch up.
#eloquent #database #query builder
🌶️ #Laravel Tip: Prefer Eloquent over Query Builder when performing updates, inserts, etc. When using Query Builder to update a record in DB, $fillable, $guarded, & the rest of Eloquent goodies are ignored. https://t.co/mi0YBvEP5z #Laravel #PHP #development
Bilal Haidar - Available 4 Laravel gigs
#commands
💡If you ever need to run processes from Laravel such as Git commands or OS-related commands, check out the Symfony Process component. It’s awesome! Let’s see some examples. 🧵Keep Reading
Martin Joo
#eloquent #relationships #eager loading
🔥 #Laravel Tip: Eager loading model relationships is way more efficient, however if used blindly, it can result in the fetching of data that you don’t actually need. To help avoid this problem, consider adding a constraint to the query…
#migrations #database
#Laravel tip 🔥 virtual generated column
mahmoud Adel
#blade #directives #html
⚡️ Did you know that Laravel now has first-party directives for conditionally outputting disabled, checked and selected attributes on HTML elements? Much nicer than if directives or ternaries.
Ryan Chandler