Laravel Pro Tips
#authorization #events #auditing #security
🔥 #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.
Matt Kingshott
#validation #arrays
Yesterday, a really useful PR got merged into Laravel! It adds a "required_array_keys" validation rule. The rule checks that all of the specified keys exist in an array. I can already think of a few places in my projects where I could use this myself 🚀 #laravel #php
Ash Allen 🚀
#responses #cache #http
Handling HTTP caching is a little tricky in #Laravel because it's can be a two-step process (eg. on pages that need to make lots of external API/database calls). Here's a basic example. I've got another package in the works that will make it much easier! https://t.co/tuuwtNH3IL
Chris #BlackLivesMatter
#dto #data
💡 This is a DTO or Data Transfer Object from the Domain-Driven Design world. It helps you: - Get rid of random arrays - Structure your unstructured data - Type-hints everywhere! 🧵 Keep Reading
Martin Joo
#security #strings
Pretty cool string helper method https://t.co/TmAq1B1mqo #laravel #php
Freek Van der Herten 🔭
#pagination #collections
🔥 #Laravel paginator tip: you can use getCollection and setCollection if you need to do something to the paginator underlying data. Trust me you'll know when you need this.
Alan Rezende 🔥 Full Stack Developer
#eloquent
Eloquent’s expressive syntax for where() clauses can help make your code more readable. Using this method can streamline the querying of any property to keep things lean. #Laravel
Kirschbaum Development
#eloquent #models
🌶️ #Laravel tip: You can use a `withDefault()` on `belongsTo` or `morphTo` to guarantee a default empty Model is returned when there is no corresponding record. Laravel Eloquent 💪 #PHP #Developers
Bilal Haidar - Available 4 Laravel gigs
#numbers #ui
🔥 #Laravel Tip: When dealing with large numbers e.g. for analytics, the exact value often becomes less important the larger it gets. It can therefore be better to simplify the value when displaying it in the UI…