dd(User::first()) 🚫
User::first()->dd() ✅
Inspired by @MrPunyapal's latest video on this exact Eloquent inconsistency, I opened a Laravel discussion to fix it.
If you care about clean DX, leave a 👍 or a comment here:
https://t.co/Yq2cRIkbdJ
Hey Developers 👩💻
Have you ever wondered why we use the hash_equals() function in PHP to compare two hashes instead of directly using string comparisons?
Well, whenever you use a direct string comparison, as soon as there is a character mismatch, the function returns false.
This means that an attacker can make multiple attempts and, based on the total response time, try to guess how successful the match was.
For example, the higher the response time, the higher the possibility of the strings matching.
To avoid such attacks, we use the hash_equals() function, which ensures that the response time remains nearly constant regardless of the number of matching characters in the string.
This makes it difficult for an attacker to determine any pattern.
#laravel #php
@MrPunyapal@PovilasKorop I feel this! Having dd() show SQL on a Model instance feels wrong. Wouldn't it be better to add a dd() method directly to the Model class to prevent it from forwarding to the query builder?
Hey @aarondfrancis, any updates on the future of FusionPHP? Still one of the most exciting concepts in the ecosystem. Would love a quick status check! ⚡️
@furiouswhopper@magadum_aniket I partially agree. A local scope would help, User::whereNullOrEmpty('middle_name')->get(). Even better, cleaning the database if possible.
When you start using third-party components and stop worrying about compatibility with the existing style system, you really understand the power of #tailwind.
#css
Laravel devs, one of my followers asked me: “Where can I see all available PHP attributes in Laravel?”
I thought about it for a bit… couldn’t find a clear answer.
So I created a repo that lists all PHP attributes used in the Laravel framework.
Link in comments 👇