I have model events:
protected static function boot()
{
parent::boot();
static::creating(function ($questionnaire) {
// Same code here
});
static::updating(function ($questionnaire) {
// Same code here
});
}
Is there a way of combining creating and updating together or is it better to put the same code in some sort of partial to reuse in each event?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Ff0WJH
via IFTTT
Aucun commentaire:
Enregistrer un commentaire