public function uploadFiles(UploadFileRequest $request)
    {
        try {
            $files = $request->file('files');
            $folder = $request->get('folder', '/');
            $uploadedFiles = new UploadedFiles($files);

            $response = $this->mediaManager->saveUploadedFiles($uploadedFiles, $folder);
            if ($response != 0) {
                $response = trans('media-manager::messages.upload_success', ['entity' => $response.' New '.str_plural('File', $response)]);
            }

            $errors = $this->mediaManager->errors();
            if (!empty($errors)) {
                return $this->errorResponse($errors, $response);
            }

            return ['success' => $response];
        } catch (\Exception $e) {
            return $this->errorResponse([$e->getMessage()]);
        }
    }
public function uploadFiles(UploadFileRequest $request)
    {
        try {
            $files = $request->file('files');
            $folder = $request->get('folder', '/');
            $uploadedFiles = new UploadedFiles($files);

            $response = $this->mediaManager->saveUploadedFiles($uploadedFiles, $folder);
            if ($response != 0) {
                $response = trans('media-manager::messages.upload_success', ['entity' => $response.' New '.str_plural('File', $response)]);
            }

            $errors = $this->mediaManager->errors();
            if (!empty($errors)) {
                return $this->errorResponse($errors, $response);
            }

            return ['success' => $response];
        } catch (\Exception $e) {
            return $this->errorResponse([$e->getMessage()]);
        }
    }
public function uploadFiles ( UploadFileRequest $ request ) { try { $ files = $ request -> file ( 'files' ) ; $ folder = $ request -> get ( 'folder' , '/' ) ; $ uploadedFiles = new UploadedFiles ( $ files ) ; $ response = $ this -> mediaManager -> saveUploadedFiles ( $ uploadedFiles , $ folder ) ; if ( $ response != 0 ) { $ response = trans ( 'media-manager::messages.upload_success' , [ 'entity' => $ response . ' New ' . str_plural ( 'File' , $ response ) ] ) ; } $ errors = $ this -> mediaManager -> errors ( ) ; if ( ! empty ( $ errors ) ) { return $ this -> errorResponse ( $ errors , $ response ) ; } return [ 'success' => $ response ] ; } catch ( \ Exception $ e ) { return $ this -> errorResponse ( [ $ e -> getMessage ( ) ] ) ; } }
Upload new file.

@param UploadFileRequest $request

@return \Illuminate\Http\JsonResponse
Upload new file .