Laravel Pro Tips
You can encrypt and decrypt model attributes with casting.
When casting "encrypted", Laravel will decrypt the value on retrieval and encrypt it when saving.
🌶️ #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 🤔
Bilal Haidar - Available 4 Laravel gigs
⚡️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.