Laravel Pro Tips
#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
#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…
Matt Kingshott
#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
#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
#casts #encryption
You can encrypt and decrypt model attributes with casting. When casting "encrypted", Laravel will decrypt the value on retrieval and encrypt it when saving.
Daniel Eckermann
#routes #redirects
📝#Laravel Tip | Need to redirect? Laravel has multiple ways of doing that. And the best part is, they all work. #laraveltip #php #tip
Bert De Swaef
#eloquent #relationships
#Laravel tip: Find Related IDs on a BelongsToMany Relationship with using allRelatedIds() method 😎
Shahghasi Adil
#performance #database
#Laravel #Database Tip: On v9.18 you can get notified when the application spends too much time querying the database during a single request. Add `whenQueryingForLongerThan` closure in the boot method of `AppServiceProvider`. 🔗https://t.co/KqffBUc8Lx #Laravel #Database #PHP
Laravel Eloquent