src/AttachableTrait.php
public function keepOnly($filenames)
    {
        $collection = collect($filenames);
        foreach($this->attaches as $attach)
        {
            if(! $collection->contains($attach->filename))
            {
                if (Storage::exists($attach->filename)) Storage::delete($attach->filename);
                $this->removeAttach($attach->filename);
            }
        }
    }
public function keepOnly($filenames)
    {
        $collection = collect($filenames);
        foreach($this->attaches as $attach)
        {
            if(! $collection->contains($attach->filename))
            {
                if (Storage::exists($attach->filename)) Storage::delete($attach->filename);
                $this->removeAttach($attach->filename);
            }
        }
    }
{@inheritdoc}