Laravel Pro Tips
#casts #mutators
๐ถ๏ธ #Laravel Tip: When using an ๐ฎ๐ฐ๐ฐ๐ฒ๐๐๐ผ๐ฟ remember to always cast the data to it's real type, even though you're casting it inside $๐ฐ๐ฎ๐๐๐. Both casts and accessors work on the actual data ๐ค #PHP #100Devs
Bilal Haidar - Available 4 Laravel gigs
#collections #filter
Laravel Collections tip. To remove all falsy values from the collection, simply call filter without any arguments โจ
Daniel Eckermann
#eloquent #models
๐ถ๏ธ #Laravel Tip: Laravel v8.23 introduced ๐๐ผ๐น๐ฒ() which is useful when you expect & want to guarantee the existence of one and only one record. Let's check an example ๐ฅ #PHP #100Devs
#blade #components #slots
#Laravel Tip๐กIf you are working with blade component slots and need to check if the slot has content at all, do it right. #blade #component #slot
Jamil Soufan
#commands #artisan
Use the then() method to ensure an Artisan command runs when another one completes. A tip from @therobfonz. #PHP #laravel #webapplicationdevelopment
Kirschbaum Development
#eloquent #models #performance
๐ถ๏ธ #Laravel Tip: There are multiple ways to return the Latest record of relation in Eloquent. However, one method will be more efficient than another. I'm sharing two ways to retrieve the `LatestLogin` of a User model. Check it out ๐คฏ #PHP #100Devs
#testing #queues
#Laravel Tip: Since todays Laravel 9.5 release you can now do partially queue faking.
Tim Geisendoerfer
#exceptions
๐ฅLaravel Tip Use Laravel's rescue() helper function instead of try / catch with an empty catch block when you want to ignore an expected exception (and avoid ugly code). https://t.co/Vx0nbqcqMT
Shawn ๐คฆ๐ปโโ๏ธ Lindstrom
#notifications #mailables
Laravel Tip ๐ก You can use the when() or unless() methods in your MailMessage notifications to set conditional object properties like a call to action.
Philo Hermans