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?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire