{ All snippets }

Tweetsnippet is a curated list of tips and tricks from Twitter.

Philo Hermans

Philo Hermans @Philo01

Laravel productivity tip! Add this little function to your bash profile to quickly execute anything with the Tinker command and get the results instantly. https://t.co/qIB9pQCTWt

Michael Dyrynda 💉💉

Michael Dyrynda 💉💉 @michaeldyrynda

🔥 An important consideration when working with @laravelphp's environment and config tooling that bit me. Keys that exist in your `.env` file with no value will not fallback to the `env()` helper's default value. To achieve the desired outcome, use null coalescing instead. https://t.co/qptuGEPzMN

Jonathan Reinink

Jonathan Reinink @reinink

🔥 Ever wondered how to set active states on links in an @inertiajs app? It's actually really easy to do! 💁‍♂️ Simply do string comparisons against the `page.url` or `page.component` properties. You can do exact matches, or "startsWith" checks, or even regular expressions! https://t.co/Gc3I917bVJ

Wes Bos

Wes Bos @wesbos

🔥 Use the modulus operator in JavaScript to find out if a number has a decimal. You can then use that in Intl.NumberFormat to trim off .00 when displaying prices of whole dollar amounts https://t.co/t59fXDJrAD

Bruno Falcão 🚀

Bruno Falcão 🚀 @brunocfalcao

🔥Laravel tip If you want to save an Eloquent model without triggering Eloquent Events use the method saveQuietly() $yourModel->saveQuietly() Lifesaver on model observers when you don't want to recursively trigger its own events (ending in an infinite loop)