Laravel Casts Explained in Under 60 Seconds #laravel #shorts

preview_player
Показать описание
In this tutorial, we'll dive into Laravel casts and how they can save time and effort when working with date attributes. Watch as we explore how to define a cast for a model attribute and automatically convert it to a date format every time you access it. With this powerful tool, you can write cleaner and more maintainable code.

📚 New Udemy Course

💌 Newsletter

🔥 Resources

#laravel #php #shorts #codewithdary
Рекомендации по теме
Комментарии
Автор

Casting JSON to an Array and then using them with livewire is a bliss

coderide
Автор

but when do we really need to use this? I mean, usually my code works without it

TheGryphon
Автор

I prefer "datetime" instead of just "date" 😀

nazmulmys
Автор

This feature has been there since Laravel version 4 I guess.

rickybarabba