Laravel Pro Tips
#Laravel Tip: 👽
Need to test that you are passing the correct data to a view? You can use the viewData method on your response. Here are some examples:
🔥 #Laravel Tip: When offering free trials, you'll end up with users that didn't convert and never deleted their accounts. Rather than keep this expired data around, configure your app to automatically purge it.
🔥 In Laravel 9, you'll be able to use the cool new "checked" Blade directive.
This is going to be a nice addition that we can use to clean up our Blade views a little bit
Ash Allen 🚀
Been using a custom @.attribute directive to clean up my Blade components this past week 😏
No more ugly string concatenation for attributes, escaping special characters, or inline @.if statements 🥴
After the success of @.class, would you like to see this in the Blade core? 🤓
Dan Harrin 🦒
🔥 #Laravel Tip: Force users to create strong passwords by setting defaults and then validating that they conform to the rules.
🌶️ #Laravel tip: Eloquent offers the magical `whereX method that you can use to replace all simple `where` statements.
Let's see it in action! 🧲
Bilal Haidar - Available 4 Laravel gigs
When getting PREVIOUS month, be careful with Carbon subMonth you might not get the result that you’re expecting. You may want to checkout subMonthWithNoOverflow instead
🔥 #Laravel Tip: Protect your database from the dangers of lazy loading by disabling it in your Laravel app. You can also customise how violations are handled, which is perfect for models outside of your control e.g. within packages.
🔥 #Laravel Tip: Tracking logins and logouts for auditing or security purposes is incredibly easy thanks to Laravel’s login and logout events. Simply listen for them in a service provider and respond when they are fired.