Hey Laravel Developers 👩💻,
🚀 In my recent tweet, we discovered cool methods like loadSum, loadMin, loadMax, and loadAvg available on a model to get aggregate values from a relation.
But guess what? Laravel makes it even simpler! You can eagerly load these aggregates while fetching a collection of models from the database using the with***() function.
Let's check it out with an example fetching aggregate values from the orders table, where the User model has a has-many relationship with the Order model.
#laravel #php
Laravel Tip
Do you want to test email contents in your app but unable/unwilling to set up something like Mailgun?
Just use the .env parameter MAIL_DRIVER=log and all the emails will be saved into storage/logs/laravel.log file, instead of being sent.
This video is controversial so that and it’s physics will be explored 🧵
As I see it the potential energy of the nails convert to kinetic energy so it transfers energy all through the box the entropy of the system is increased 1/🧵
@enunomaduro hi Nuno, I’m trying to use Pest Architecture test in an helper file loaded using composer “autoload” but it doesn’t seems to check any dd() on it, doesn’t Pest be able to work on autoloaded files?
In 1960, David Latimer planted a spiderwort sprout inside of a large glass jar, added a quarter pint of water, and then sealed it shut.
He opened the bottle for the first time only 12 years later, in 1972, to add some water and then sealed it for good.
The self-contained ecosystem flourished for more than 60 years as a perfectly balanced garden and self-sufficient ecosystem.
The bacteria in the compost ate the dead plants and broke down the oxygen released, turning it into carbon dioxide, essentially forming a microcosm of Earth.
📯 Lazy JSON is unleashed!
- read JSON of any size and from anywhere while consuming only a few KB
- recursively load JSON objects/arrays in @laravelphp Lazy Collections
- extract only some subtrees with a dot-notation syntax
- fully tested with @pestphp
https://t.co/c1TD1Fdbcu
How has AI changed your daily work as a coder?
Mine a lot!
➡️ Autocompletion through Copilot
➡️ Fully suggestions by Copilot (e.g., tests)
➡️ I often discuss complex code or TypeScript (😅) with ChatGPT through @raycastapp
I'm pretty sure I write 20% less code than before.