Plank\Mediable\Mediable::handleMediableDeletion PHP Метод

handleMediableDeletion() защищенный Метод

Determine whether media relationships should be detached when the model is deleted or soft deleted.
protected handleMediableDeletion ( ) : void
Результат void
    protected function handleMediableDeletion()
    {
        // only cascade soft deletes when configured
        if (static::hasGlobalScope(SoftDeletingScope::class) && !$this->forceDeleting) {
            if (config('mediable.detach_on_soft_delete')) {
                $this->media()->detach();
            }
            // always cascade for hard deletes
        } else {
            $this->media()->detach();
        }
    }