Illuminate\Database\Eloquent\Model::touchOwners PHP Method

touchOwners() public method

Touch the owning relations of the model.
public touchOwners ( ) : void
return void
    public function touchOwners()
    {
        foreach ($this->touches as $relation) {
            $this->{$relation}()->touch();
            if ($this->{$relation} instanceof self) {
                $this->{$relation}->fireModelEvent('saved', false);
                $this->{$relation}->touchOwners();
            } elseif ($this->{$relation} instanceof Collection) {
                $this->{$relation}->each(function (Model $relation) {
                    $relation->touchOwners();
                });
            }
        }
    }
Model