src/MediaTrait.php
public function deleteMedia($group = NULL) {
    $media = $this->getMedia($group);

    $count = 0;
    foreach ($media as $item) {
      $count += (int) $this->removeMedia($item);
    }

    return $count;
  }
public function deleteMedia($group = NULL) {
    $media = $this->getMedia($group);

    $count = 0;
    foreach ($media as $item) {
      $count += (int) $this->removeMedia($item);
    }

    return $count;
  }
Delete all the media assigned to the current model instance

@param $group string
The file group to delete

@return int
The number of elements deleted