Laravel 5.7. I have 2 models: Foo
and Content
:
class Foo extends Model
{
public static function boot()
{
parent::boot();
static::updated(function() {
dd('here');
});
}
public function contents()
{
return $this->morphToMany('App\Content');
}
}
class Content extends Model
{
protected $touches = ['foos'];
public function foos()
{
return $this->morphedByMany('App\Foo');
}
}
When Content
is updated, it correctly touches Foo
, updating its updated_at
timestamp. But the static::updated
method is not called. I would expect it to be called since Foo
has been updated.