Laravel Pro Tips
#models #casts #orm
So I heard y'all like types in your ORM. Laravel allows you to define casts at the model level to handle casting values to their native types. More interestingly, it also allows you to define them at query time, so you're not sacrificing the power of SQL ๐
Aaron Francis
#casts #encryption
You can encrypt and decrypt model attributes with casting. When casting "encrypted", Laravel will decrypt the value on retrieval and encrypt it when saving.
Daniel Eckermann
#casts #mutators
๐ถ๏ธ #Laravel Tip: When using an ๐ฎ๐ฐ๐ฐ๐ฒ๐๐๐ผ๐ฟ remember to always cast the data to it's real type, even though you're casting it inside $๐ฐ๐ฎ๐๐๐. Both casts and accessors work on the actual data ๐ค #PHP #100Devs
Bilal Haidar
#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:
Martin Joo
No articles were found.