src/AttachableTrait.php
public function removeAttach($name)
    {
        $namespace = $this->getEntityClassName();

        $attach = $this
            ->createAttachesModel()
            ->whereNamespace($namespace)
            ->where(function ($query) use ($name) {
                $query
                    ->orWhere('title', $name)
                    ->orWhere('filename', $name)
                ;
            })
            ->first()
        ;
        if ($attach) {
            $this->attaches()->detach($attach);
        }
    }
public function removeAttach($name)
    {
        $namespace = $this->getEntityClassName();

        $attach = $this
            ->createAttachesModel()
            ->whereNamespace($namespace)
            ->where(function ($query) use ($name) {
                $query
                    ->orWhere('title', $name)
                    ->orWhere('filename', $name)
                ;
            })
            ->first()
        ;
        if ($attach) {
            $this->attaches()->detach($attach);
        }
    }
{@inheritdoc}