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

detachMedia() публичный Метод

Detach a media item from the model.
public detachMedia ( mixed $media, string | array | null $tags = null ) : void
$media mixed
$tags string | array | null If provided, will remove the media from the model for the provided tag(s) only If omitted, will remove the media from the media for all tags
Результат void
    public function detachMedia($media, $tags = null)
    {
        $query = $this->media();
        if ($tags) {
            $query->wherePivotIn('tag', (array) $tags);
        }
        $query->detach($media);
        $this->markMediaDirty($tags);
    }