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();
}
}