protected function _postSetAttributes()
{
if ($this->_multiple) {
- $this->setAttribute('type', 'upload_multiple');
+ $this->setAttribute('type', 'browse_multiple');
} else {
- $this->setAttribute('type', 'upload');
+ $this->setAttribute('type', 'browse');
}
- return parent::_postSetAttributes();
- }
-
- public function setMutator($value)
- {
- $model = $this->getModelInstance();
-
- $function = $this->_multiple ? 'uploadMultipleToDisk' : 'uploadToDisk';
- $path = $model->getAttribute('name') . '/' . $model->getPrimaryKey();
-
- $model->$function($value, $this->getAttribute('name'), $this->getAttribute('disk'), $path);
+ parent::_postSetAttributes();
}
}
class Images extends Files
{
protected $_mimeTypes = ['image/png', 'image/jpeg', 'image/svg+xml', 'image/webp', 'image/gif'];
-
- protected function _postSetAttributes()
- {
- if ($this->_multiple) {
- $this->setAttribute('type', 'upload_multiple');
- } else {
- $this->setAttribute('type', 'image');
- }
-
- return parent::_postSetAttributes();
- }
}