multiple) { $this->multiple = 0; } if (! $this->validate) { $this->validate = 0; } if (! $this->preview) { $this->preview = 0; } if (! $this->required) { $this->required = 0; } if (! $this->disabled) { $this->disabled = 0; } if (is_string($this->accept)) { $this->accept = explode(',', $this->accept); } $this->accept = array_map('trim', $this->accept); $this->accept = array_filter($this->accept); $this->accept = array_unique($this->accept); $this->accept = array_values($this->accept); $this->accept = array_map('strtolower', $this->accept); $fileTypes = $this->accept; $this->accept = json_encode($this->accept); $this->sizeHuman = $this->size; foreach ($fileTypes as $type) { $new = explode('/', $type); if (array_key_exists(1, $new)) { $this->acceptHuman[] = ".{$new[1]}"; } } $this->acceptHuman = implode(', ', $this->acceptHuman); return view('components.field.upload-file'); } }