Laravel Pro Tips
#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
#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
#scheduler
π‘ #Laravel Tips of the day π Laravel ππΈπΆπ½ πΊπ²ππ΅πΌπ± πΆπ» ππ°π΅π²π±ππΉπ²πΏ - We can use skip in your commands to skip an execution. #php #backend
vigowebs
#requests #carbon #dates
π₯ If you've ever found yourself manually dealing with request inputs looking to parse it to Carbon. You might want to use the `date` method on the Request instance instead. #Laravel #PHP
Morten Poul Jensen