In your Eloquent Models, you can provide casts to automatically cast database columns to some type that you would need to use separately with that type of logic. Probably the most popular example is about date type.
In the User Model, by default, the email_verified_at
is cast to datetime
.
class User extends Authenticatable{ // ... protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; }}
What does this cast mean? It means that it will be automatically...