PHPackages                             klongchu/laravel-docuware-fix-budhosp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. klongchu/laravel-docuware-fix-budhosp

ActiveLibrary[API Development](/categories/api)

klongchu/laravel-docuware-fix-budhosp
=====================================

DocuWare integration with Laravel

08011[1 PRs](https://github.com/klongchu/laravel-docuware-1.1.5/pulls)PHP

Since Apr 24Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/klongchu/laravel-docuware-1.1.5)[ Packagist](https://packagist.org/packages/klongchu/laravel-docuware-fix-budhosp)[ RSS](/packages/klongchu-laravel-docuware-fix-budhosp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![](https://camo.githubusercontent.com/4bf4225c3a9875c26a21fd07b734caaaf83798321885f70528f25cb2ab07dbed/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230446f6375576172652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f64656261722d61672532466c61726176656c2d646f637577617265267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d416e2b6f70696e696f6e617465642b7761792b746f2b696e746567726174652b446f6375576172652b776974682b4c61726176656c266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313735707826696d616765733d646f63756d656e742d7265706f7274)](https://camo.githubusercontent.com/4bf4225c3a9875c26a21fd07b734caaaf83798321885f70528f25cb2ab07dbed/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230446f6375576172652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f64656261722d61672532466c61726176656c2d646f637577617265267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d416e2b6f70696e696f6e617465642b7761792b746f2b696e746567726174652b446f6375576172652b776974682b4c61726176656c266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313735707826696d616765733d646f63756d656e742d7265706f7274)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5741a7d9912f58a5dd57b71327acda1eedd78173ba77db1d9db4add90a40f905/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656261722d61672f6c61726176656c2d646f6375776172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codebar-ag/laravel-docuware)[![GitHub-Tests](https://github.com/codebar-ag/laravel-docuware/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-docuware/actions/workflows/run-tests.yml)[![GitHub Code Style](https://github.com/codebar-ag/laravel-docuware/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-docuware/actions/workflows/fix-php-code-style-issues.yml)[![Total Downloads](https://camo.githubusercontent.com/b0e4d8d7407c2a516e03d045b00bad2dd79780512e88a7cc06cd28025441193c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656261722d61672f6c61726176656c2d646f6375776172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codebar-ag/laravel-docuware)

This package was developed to give you a quick start to communicate with the DocuWare REST API. It is used to query the most common endpoints.

⚠️ This package is not designed as a replacement of the official [DocuWare REST API](https://developer.docuware.com/rest/index.html). See the documentation if you need further functionality. ⚠️

💡 What is DocuWare?
-------------------

[](#-what-is-docuware)

DocuWare provides cloud document management and workflow automation software that enables you to digitize, secure and work with business documents, then optimize the processes that power the core of your business.

🛠 Requirements
--------------

[](#-requirements)

### &gt; = v2.0

[](#--v20)

- PHP: `^8.1` |`^8.2`
- Laravel: `^9.*` | `^10.*`
- DocuWare Cloud Access
-

### &gt; = v1.2

[](#--v12)

- PHP: `^8.1`
- Laravel: `^9.*`
- DocuWare Cloud Access

### &lt; v1.2

[](#-v12)

- PHP: `^8.0`
- Laravel: `^8.*`
- DocuWare Cloud Access

⚙️ Installation
---------------

[](#️-installation)

You can install the package via composer:

```
composer require codebar-ag/laravel-docuware
```

Add the following environment variables to your `.env` file: The "DOCUWARE\_COOKIES" variable is optional and only used if you want to set the request cookie manually.

```
DOCUWARE_URL=https://domain.docuware.cloud
DOCUWARE_USERNAME=user@domain.test
DOCUWARE_PASSWORD=password
DOCUWARE_PASSPHRASE="passphrase"
DOCUWARE_COOKIES="cookie"
```

With the passphrase we are able to encrypt the URLs.

⚠️ You need to escape backslashes in your passphrase with another backslash:

```
# ❌ Passphrase contains a backslash and is not escaped:
DOCUWARE_PASSPHRASE="a#bcd>2~C1'abc\#"

# ✅ We need to escape the backslash with another backslash:
DOCUWARE_PASSPHRASE="a#bcd>2~C1'abc\\#"
```

🏗 Usage
-------

[](#-usage)

```
use CodebarAg\DocuWare\Facades\DocuWare;

/**
 * Return all file cabinets.
 */
$cabinets = DocuWare::getFileCabinets();

/**
 * Return all fields of a file cabinet.
 */
$fields = DocuWare::getFields($fileCabinetId);

/**
 * Return all dialogs of a file cabinet.
 */
$dialogs = DocuWare::getDialogs($fileCabinetId);

/**
 * Return all used values for a specific field.
 */
$values = DocuWare::getSelectList($fileCabinetId, $dialogId, $fieldName);

/**
 * Return a document.
 */
$document = DocuWare::getDocument($fileCabinetId, $documentId);

/**
 * Return image preview of a document.
 */
$content = DocuWare::getDocumentPreview($fileCabinetId, $documentId);

/**
 * Download single document.
 */
$content = DocuWare::downloadDocument($fileCabinetId, $documentId);

/**
 * Download multiple documents.
 */
$content = DocuWare::downloadDocuments($fileCabinetId, $documentIds);

/**
 * Update value of a indexed field.
 */
$value = DocuWare::updateDocumentValue($fileCabinetId, $documentId, $fieldName, $newValue);

/**
 * Upload new document.
 */
$document = DocuWare::uploadDocument($fileCabinetId, $fileContent, $fileName);

/**
 * Upload new document with index values.
 */
use CodebarAg\DocuWare\DTO\DocumentIndex;

$indexes = collect([
    DocumentIndex::make('DOCUMENT_TEXT', 'Indexed Text'),
    DocumentIndex::make('DOCUMENT_NUMBER', 42),
]);

$document = DocuWare::uploadDocument(
    $fileCabinetId,
    $fileContent,
    $fileName,
    $indexes,
);

/**
 * Delete document.
 */
DocuWare::deleteDocument($fileCabinetId, $documentId);
```

🔍 Search usage
--------------

[](#-search-usage)

```
use CodebarAg\DocuWare\Facades\DocuWare;

/**
 * Most basic example to search for documents. You only need to provide a valid
 * file cabinet id.
 */
$id = '87356f8d-e50c-450b-909c-4eaccd318fbf';

$paginator = DocuWare::search()
    ->fileCabinet($id)
    ->get();

/**
 * Search in multiple file cabinets. Provide an array of file cabinet ids.
 */
$fileCabinetIds = [
    '0ee72de3-4258-4353-8020-6a3ff6dd650f',
    '3f9cb4ff-82f2-44dc-b439-dd648269064f',
];

$paginator = DocuWare::search()
    ->fileCabinets($fileCabinetIds)
    ->get();

/**
 * Find results on the next page.
 *
 * Default: 1
 */
$paginator = DocuWare::search()
    ->fileCabinet($id)
    ->page(2)
    ->get();

/**
 * Define the number of results which should be shown per page.
 *
 * Default: 50
 */
$paginator = DocuWare::search()
    ->fileCabinet($id)
    ->perPage(30)
    ->get();

/**
 * Use the full-text search. You have to activate full-text search in your file
 * cabinet before you can use this feature.
 */
$paginator = DocuWare::search()
    ->fileCabinet($id)
    ->fulltext('My secret document')
    ->get();

/**
 * Search documents which are created from the first of march.
 */
$paginator = DocuWare::search()
    ->fileCabinet($id)
    ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021, 3, 1))
    ->get();

/**
 * Search documents which are created until the first of april.
 */
$paginator = DocuWare::search()
    ->fileCabinet($id)
    ->filterDate('DWSTOREDATETIME', '=', Carbon::create(2021, 3, 1))
    ->filterDate('DWSTOREDATETIME','
