Laravel Pro Tips
#performance #database #enums
🔥 #Laravel Tip: DB queries that need to examine string columns will always be slower than queries which only need to examine integer columns. Therefore, consider whether you can use integers in place of strings for those columns. It can make a big difference on large data sets.
Matt Kingshott
#enums #traits
A few days ago, I learned that PHP enums can use traits It may seem like a massive anti-pattern, but it allows making enums actually awesome with this one trick 🔥
ARCHTECH
#routes #enums
🔥Laravel 9 introduced enum route bindings! You can type-hint your enum and Laravel will cast the string value from the URL:
Martin Joo
#eloquent #enums #casts
⚡️Using enums is a joy with Laravel. For example, you can cast string Eloquent properties to enum values using the casts property:
No articles were found.