src/Mediable.php
public function detachMedia($media, $tags = null)
    {
        $query = $this->media();
        if ($tags) {
            $query->wherePivotIn('tag', (array) $tags);
        }
        $query->detach($media);
        $this->markMediaDirty($tags);
    }
public function detachMedia($media, $tags = null)
    {
        $query = $this->media();
        if ($tags) {
            $query->wherePivotIn('tag', (array) $tags);
        }
        $query->detach($media);
        $this->markMediaDirty($tags);
    }
public function detachMedia ( $ media , $ tags = null ) { $ query = $ this -> media ( ) ; if ( $ tags ) { $ query -> wherePivotIn ( 'tag' , ( array ) $ tags ) ; } $ query -> detach ( $ media ) ; $ this -> markMediaDirty ( $ tags ) ; }
Detach a media item from the model.
@param  mixed                $media
@param  string|string[]|null $tags
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
@return void
Detach a media item from the model .