public function deleteDirectories($model, $parentRelation = null)
    {
        $id = is_null($parentRelation) ? $model->id : $model->$parentRelation->id;
        foreach($this->options as $option){
            $this->deleteDirectory($option['path'] . "/{$id}");
        }
    }
public function deleteDirectories($model, $parentRelation = null)
    {
        $id = is_null($parentRelation) ? $model->id : $model->$parentRelation->id;
        foreach($this->options as $option){
            $this->deleteDirectory($option['path'] . "/{$id}");
        }
    }
public function deleteDirectories ( $ model , $ parentRelation = null ) { $ id = is_null ( $ parentRelation ) ? $ model -> id : $ model -> $ parentRelation -> id ; foreach ( $ this -> options as $ option ) { $ this -> deleteDirectory ( $ option [ 'path' ] . "/{$id}" ) ; } }
delete multiple directories with model path

@param \Illuminate\Database\Eloquent\Model $model
@param string|null $parentRelation
delete multiple directories with model path