mercredi 23 novembre 2016

Extending Laravel's base model

In Laravel all models extend the base model.

The laravel eloquent models have a protected array attribute called $dates. Every date that is beeing added to this array is automatically converted to a Carbon instance.

I would like to extend the base model with similar functionality. For example with a protected $times attribute. All the time attributes would be converted to a Carbon instance

How would you do this?

Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire