PHPackages                             lasselehtinen/elvis - 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. lasselehtinen/elvis

Abandoned → [lasselehtinen/woodwing-assets](/?search=lasselehtinen%2Fwoodwing-assets)Library[API Development](/categories/api)

lasselehtinen/elvis
===================

Package for doing REST API queries against Woodwings Elvis DAM (Digital Asset Management)

v6.0.3(3y ago)125.2k1BSD-2-ClausePHPPHP &gt;=8.0

Since Oct 20Pushed 3y ago2 watchersCompare

[ Source](https://github.com/lasselehtinen/elvis)[ Packagist](https://packagist.org/packages/lasselehtinen/elvis)[ RSS](/packages/lasselehtinen-elvis/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (5)Versions (22)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/0e83a9284adc13fac525c4c0236252a05ec20d5ff7162fb41a3c394ad01fc1c1/68747470733a2f2f706f7365722e707567782e6f72672f6c617373656c656874696e656e2f656c7669732f762f737461626c652e737667)](https://packagist.org/packages/lasselehtinen/elvis)[![Total Downloads](https://camo.githubusercontent.com/357bf8e0529ff15d36bd931e39163a71d276a464c823d7185c2843c221469a3e/68747470733a2f2f706f7365722e707567782e6f72672f6c617373656c656874696e656e2f656c7669732f646f776e6c6f6164732e737667)](https://packagist.org/packages/lasselehtinen/elvis)[![Latest Unstable Version](https://camo.githubusercontent.com/47500c052bf6895b1e29deec52519a697f2c11bb6df60320b237cbbeaed761a9/68747470733a2f2f706f7365722e707567782e6f72672f6c617373656c656874696e656e2f656c7669732f762f756e737461626c652e737667)](https://packagist.org/packages/lasselehtinen/elvis)[![License](https://camo.githubusercontent.com/855822f9449f3043f0a47020942fb9315210806e9a3c486653af90cca844d97c/68747470733a2f2f706f7365722e707567782e6f72672f6c617373656c656874696e656e2f656c7669732f6c6963656e73652e737667)](https://packagist.org/packages/lasselehtinen/elvis)

Installation
============

[](#installation)

---

Laravel 5.X
-----------

[](#laravel-5x)

### Step 1

[](#step-1)

Add the package to your `composer.json` and run `composer update`.

```
{
    "require": {
        "lasselehtinen/elvis": "3.0.0"
    }
}

```

### Step 2

[](#step-2)

Add the service provider and alias in `config/app.php`:

```
'providers' => array(
    ...
    Lasselehtinen\Elvis\ElvisServiceProvider::class
),

```

### Step 3

[](#step-3)

Publish the package config file by running:

```
php artisan vendor:publish

```

This copies the Elvis config to config/Elvis.php and references to the .env configuration file used by Laravel 5. So edit the .env file and add the following entries:

```
ELVIS_API_ENDPOINT_URI='http://elvis.domain.com/services/',
ELVIS_USERNAME='elvis_username',
ELVIS_PASSWORD='elvis_password'

```

Laravel 4.X
-----------

[](#laravel-4x)

### Step 1

[](#step-1-1)

Add the package to your `composer.json` and run `composer update`.

```
{
    "require": {
        "lasselehtinen/elvis": "1.0.1"
    }
}

```

### Step 2

[](#step-2-1)

Add the service provider and alias in `app/config/app.php`:

```
'providers' => array(
    ...
    'Lasselehtinen\Elvis\ElvisServiceProvider'
),

```

And

```
'aliases' => array(
    ...
    'Elvis'           => 'Lasselehtinen\Elvis\Facades\Elvis'
),

```

### Step 3

[](#step-3-1)

Publish the package config file by running:

```
php artisan config:publish lasselehtinen/elvis

```

Edit your `app/config/packages/lasselehtinen/elvis/config.php` and change the default Elvis REST API endpoint URI and the username and password.

Usage
=====

[](#usage)

List of supported functions
---------------------------

[](#list-of-supported-functions)

- [Login](#login)
- [Browse](#browse)
- [Search](#search)
- [Profile](#profile)
- [Create](#create)
- [Update](#update)
- [Updatebulk](#updatebulk)
- [Move / rename](#move)
- [Copy](#copy)
- [Remove](#remove)
- [Create folder](#createfolder)
- [Create relation](#createrelation)
- [Remove relation](#removerelation)
- [Log usage stats](#logusagestats)
- [Messages / Localization](#messages)
- [Checkout](#checkout)
- [Undocheckout](#undocheckout)
- [CreateAuthKey](#createAuthKey)
- [UpdateAuthKey](#updateAuthKey)
- [RevokeAuthKeys](#revokeAuthKeys)
- [Logout](#logout)

### Login

[](#login)

You need to login as the first step. Store the CSRF token returned by the function and pass it to further requests.

```
$token = Elvis::login();
$search_results = Elvis::search($token, 'gtin:9789510123454');

```

### Browse

[](#browse)

This call is designed to allow you to browse folders and show their subfolders and collections, similar to how folder browsing works in the Elvis desktop client. Read more at .

> Note: Even though it is possible to return the assets in folders, doing so is not advised. The browse call does not limit the number of results, so if there are 10000 assets in a folder it will return all of them. It is better to use a search to find the assets in a folder and fetch them in pages.

```
$browse_results = Elvis::browse($token, '/Folder/');

```

ParameterDescriptiontokenCSRF token returned by the login function.pathThe path to the folder in Elvis you want to list. Path is automatically encoded.fromRootAllows returning multiple levels of folders with their children. When specified, this path is listed, and all folders below it up to the 'path' will have their children returned as well. This ability can be used to initialize an initial path in a column tree folder browser with one server call.includeFoldersIndicates if folders should be returned.includeAssetIndicates if files should be returned.includeExtensionsA comma separated list of file extensions to be returned. Specify 'all' to return all file types.### Search

[](#search)

Wrapper for the search API, returns the hits found. You can find more information at . You can find details about the function parameters below.

**Simple search:**

```
$search_results = Elvis::search($token, 'gtin:9789510123454');

```

ParameterDescriptiontokenCSRF token returned by the login function.queryActual Lucene query, you can find more details in startFirst hit to be returned. Starting at 0 for the first hit. Used to skip hits to return 'paged' results. Default is 0.numNumber of hits to return. Specify 0 to return no hits, this can be useful if you only want to fetch facets data. Default is 50.sortThe sort order of returned hits. Comma-delimited list of fields to sort on. Read more at metadataToReturnComma-delimited list of metadata fields to return in hits. It is good practice to always specify just the metadata fields that you need. This will make the searches faster because less data needs to be transferred over the network. Read more at appendRequestSecretWhen set to true will append an encrypted code to the thumbnail, preview and original URLs.facetsToReturnComma-delimited list fields to return facets for.facetSelectionArray of facets and values with the facet as the key and the comma-delimited list of values that should be 'selected' for a given facet as the value. For example \['tags' =&gt; 'beach,ball', 'assetDomain' =&gt; 'image,video'\].### Profile

[](#profile)

Retrieve details about the authenticated user.

```
$profile = Elvis::profile($token);

```

### Create

[](#create)

This call will create a new asset in Elvis. It can be used to upload files into Elvis. It can also be used to create 'virtual' assets like collections. In that case no file has to be uploaded and Elvis will create a 0 kb placeholder for the virtual asset. Read more at .

**Note:** Either assetPath, filename or name as to be specified in the metadata.

```
$create = Elvis::create($token, './file.txt', array('assetPath' => '/Users/demouser/filename.txt'));

```

ParameterDescriptiontokenCSRF token returned by the login function.filenameThe local filename to be created in Elvis. If you do not specify a filename explicitly through the metadata, the filename of the uploaded file will be used. Please note that in this case, you give the local filepath as a parameter. The wrapper will then convert it multipart/file.metadataArray containing the metadata for the asset as an array. Key is the metadata field name and value is the actual value.### Update

[](#update)

This call updates an existing asset in Elvis with a new file. It can also be used to update metadata. Works pretty much the same ways a create. Only difference is that you given additional parameter, the asset id. Read more at .

```
$update = Elvis::update($token, '1_OSDdstqxbACb97Vd-ret', null, array('Description' => 'Nice view'));

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards Elvisasset\_idElvis asset id to be updatedfilenameThe file that will replace the current file. Define as null if you just want to update metadata.metadataArray containing the metadata for the asset as an array. Key is the metadata field name and value is the actual value.### Updatebulk

[](#updatebulk)

This call updates the metadata of multiple existing assets in Elvis.

*Available since Elvis 3.1*

```
$updatebulk = Elvis::updatebulk($token, 'tags:animal', array('status' => 'Correction'));

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvisqA query matching the assets that should be updatedmetadataArray containing the metadata for the assets as an array. Key is the metadata field name and value is the actual value.asyncWhen true, the process will run asynchronous in the background. The call will return immediate with the processId. By default, the call waits for the process to finish and then returns the processedCount.Returns either processedCount or processId depending on the value of async.

### Move / rename

[](#move--rename)

Move or rename a folder or a single asset. You can combine a rename operation and a move operation. Just specify the new target path.

When you move or rename a folder, all assets contained in the folder will also be moved to the new location. The subfolder structure will be kept intact.

```
$rename = Elvis::move($token, '/Path/to/asset/filename.ext', '/Path/to/asset/new-filename.ext');

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvissourceEither a folderPath or assetPath of the folder or asset to be moved or renamed.targetThe folderPath or assetPath to which the folder or asset should be moved or renamed. If the parent folder is the same as in the source path, the asset will be renamed, otherwise it will be moved.)folderReplacePolicyPolicy used when destination folder already exists. Aither AUTO\_RENAME (default), MERGE or THROW\_EXCEPTION.fileReplacePolicyPolicy used when destination asset already exists. Either AUTO\_RENAME (default), OVERWRITE, OVERWRITE\_IF\_NEWER, REMOVE\_SOURCE, THROW\_EXCEPTION or DO\_NOTHINGfilterQueryWhen specified, only source assets that match this query will be moved.flattenFoldersWhen set to true will move all files from source subfolders to directly below the target folder. This will 'flatten' any subfolder structure.Please see  for more information about the folderReplacePolicy and fileReplacePolicy.

### Copy

[](#copy)

Copy a folder or a single asset.

When you copy a folder, all subfolders and assets contained in it will also be copied to the new location. The subfolder structure will be kept intact unless you set flattenFolder to true.

```
$copy = Elvis::copy($token, '/Path/to/asset/filename.ext', '/Path/to/asset/copy-filename.ext');

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvissourceEither a folderPath or assetPath of the folder or asset to be moved or renamed.targetThe folderPath or assetPath to which the folder or asset should be moved or renamed. If the parent folder is the same as in the source path, the asset will be renamed, otherwise it will be moved.)folderReplacePolicyPolicy used when destination folder already exists. Aither AUTO\_RENAME (default), MERGE or THROW\_EXCEPTION.fileReplacePolicyPolicy used when destination asset already exists. Either AUTO\_RENAME (default), OVERWRITE, OVERWRITE\_IF\_NEWER, REMOVE\_SOURCE, THROW\_EXCEPTION or DO\_NOTHINGfilterQueryWhen specified, only source assets that match this query will be moved.flattenFoldersWhen set to true will move all files from source subfolders to directly below the target folder. This will 'flatten' any subfolder structure.Please see  for more information about the folderReplacePolicy and fileReplacePolicy.

Returns either processedCount or processId depending on the value of async.

### Remove

[](#remove)

Remove one or more assets. This will remove only assets, no folders.

```
$ids = array('1_OSDdstqxbACb97Vd-ret', '1wefOS6bauK8uRxi0rn9EK');
$remove = Elvis::remove($token, null, $ids, null, false);

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvisqueryA query that matches all assets to be removed. Be careful with this and make sure you test your query using a search call to prevent removing assets that you did not want to be removed.idsArray containing the assetId's for the assets to be removed. Be careful with this and make sure you test your query using a search call to prevent removing assets that you did not want to be removed.folderPathThe folderPath of the folder to remove. All assets and subfolders will be removed.asyncWhen true, the process will run asynchronous in the background. The call will return immediate with the processId. By default, the call waits for the process to finish and then returns the processedCount.Either 'q' or 'ids' or 'folderPath' must be specified.

Returns either processedCount or processId depending on the value of async.

### Create folder

[](#create-folder)

Remove one or more assets. This will remove only assets, no folders.

```
$createFolder = Elvis::createFolder($token, '/Users/lasleh/New');

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvispathThe full folderPath of the folder to be created.Returns an object with the olderPaths of each folder as key with the corresponding result as value (always a string). The following results are possible:

- "created"
- "already exists"
- "access denied"
- an error message indicating why the folder could not be created
-

### Create relation

[](#create-relation)

Remove one or more assets. This will remove only assets, no folders.

```
$createRelation = Elvis::createRelation($token, 'contains', 'FWiH0ipWKVl8CkbFGm9me9', 'CFN7pN2S4GFBz4Vorc34VJ');

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvisrelationTypeThe type of relation to create. Read more at target1IdThe id of the asset on one side of the relation.target2IdThe id of the asset on one side of the relation.metadataA JSON encoded object with properties that match Elvis relation metadata field names. This metadata will be set on the relation in Elvis.The operation returns an empty 200 OK status. If the operation fails, an error page with a 500 error status will be returned.

### Remove relation

[](#remove-relation)

Remove one or more relations between assets.

```
$removeRelation = Elvis::removeRelation($token, ['77-nZwDXaTJ96lhhaDvp0t']);

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvisrelationIdsArray containing relation id's to be removed. To find the relation ids, use a relation search. The operation returns an empty 200 OK status.

If the operation fails, an error page with a 500 error status will be returned.

### Log usage stats

[](#log-usage-stats)

Logs an entry in the stats database for usage statistics about assets. A record will be added to the "usage\_log" table, see [Query stats](#querystats) for details.

```
$logUsage = Elvis::logUsage($token, 'FWiH0ipWKVl8CkbFGm9me9', 'CUSTOM_ACTION_test', array('metadataKey'=>'value'));

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvisassetIdThe id of the asset for which the action is logged.actionName of the action that is logged. This must start with "CUSTOM\_ACTION\_", if it does not, this prefix will be added to the logged action name.additionalQueryParametersArray of additional query parameters that are logged as details for the action.This call does not return a value, it only returns an http 200 status OK.

### Messages / Localization

[](#messages--localization)

Retrieve message bundles from the Elvis server.

Allows localization of a custom plugin using messages available on the server. The messages from the webclient web or desktop client acm can be used in your own plugin. It is also possible to use any custom messages defined in the Config/messages folder.

The common message bundle cmn is always returned and merged with the requested bundle. The common bundle contains messages for relations, metadata fields, metadata groups and metadata values. The common message keys have the following structure:

**Relations:**

```
relation.[relation type].label

```

**Metadata fields:**

```
field_label.[field name]

```

**Metadata groups:**

```
field_group_label.[group name]

```

**Metadata values:**

```
field_value_label.[field name].[value]

```

For a full list of available messages see this [knowledge base article](https://helpcenter.woodwing.com/hc/en-us/articles/202967365-Translating-clients).

```
 $messages = Elvis::messages($token, 'fi_FI');

```

ParameterDescriptionsessionIdSession ID returned by the login function. This is used for further queries towards ElvislocalChainArray containing list of locales, the first supplied locale is leading. If a message is missing for a locale it will fall back to the next locale in the chain for that message.ifModifiedSinceThe date of the last requested cached messages, specified in milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.bundleThe bundle to return, can be either web or acm. The cmn bundle will always be returned combined with the requested bundle.The service returns an object containing all keys and messages. Please note that commas in object properties have to be referenced like this:

```
$messages->{'field_label.creatorEmail'}

```

### Checkout

[](#checkout)

Checks out an asset from the system locking the file for other users.

```
$checkout= Elvis::checkout($token, $assetId);

```

ParameterDescriptionsessionIdSession ID returned by the login function.assetIdThe Elvis id of the asset to be checked out.This will return the checkout metadata in the response as an object.

### Undocheckout

[](#undocheckout)

Undo a checkout for a single asset

```
$checkout = Elvis::undocheckout($token, $assetId);

```

ParameterDescriptionsessionIdSession ID returned by the login function.assetIdElvis id of the asset that was checked out.### CreateAuthKey

[](#createauthkey)

Create an authKey in Elvis.

```
$createAuthKey = Elvis::createAuthKey($token, 'Test', '2999-01-01', array($assetId));

```

ParameterDescriptionsessionIdSession ID returned by the login function.subjectAuthKey subjectvalidUntilExpiry date, in one of the date formats supported by Elvis. See  for more detailsassetIdsArray of of asset id's to share, do not specify for a pure upload request (requestUpload must be true is this case)descriptionAuthKey description that will be shown to receiver of the link.downloadOriginalAllow downloading original files. Setting this to true will automatically force downloadPreview to true as well.downloadPreviewAllow viewing and downloading previews. Setting this to false will only show thumbnails and will also force downloadOriginal to false.requestApprovalRequest for approval.requestUploadAllow uploading new files, must be true when asset id's is not specified.containerIdContainer asset id which uploaded files are related to. Only relevant when requestUpload=true.importFolderPathfolderPath where files are uploaded. Required when requestUpload=true.notifyEmailEmail address to send notifications to when upload or approval is finished. Only relevant when requestUpload=true or requestApproval=true.sortClient setting, specify a comma-delimited list of fields to sort the results on. Follows the same behavior as sort in REST - search callviewModeClient setting. Possible values 'thumbnail', 'list' or 'mason'.thumbnailFieldsClient setting, array containing list of fieldnames for showing metadata in the thumbnail view.listviewFieldsClient setting, array containing list of fieldnames for showing metadata in the list view.filmstripFieldsClient setting, array containing list of fieldnames for showing metadata in the filmstrip view.thumbnailZoomLevelClient setting, thumbnail zoom level in the thumbnail view.listviewZoomLevelClient setting, thumbnail zoom level in the list view.filmstripZoomLevelClient setting, thumbnail zoom level in the filmstrip view.Returns object containing the authKey and links to different clients.

### UpdateAuthKey

[](#updateauthkey)

Update an authKey in Elvis.

With this API call it is possible to update certain properties of an authKey. Please note that it is not possible to add or remove assets from an authKey once it has been created.

```
$updateAuthKey = Elvis::updateAuthKey($token, $authKey, 'Test', '2999-02-02');

```

ParameterDescriptionsessionIdSession ID returned by the login function.keyThe authKey which will be updated.subjectAuthKey subjectvalidUntilExpiry date, in one of the date formats supported by Elvis. See  for more detailsdescriptionAuthKey description that will be shown to receiver of the link.downloadOriginalAllow downloading original files. Setting this to true will automatically force downloadPreview to true as well.downloadPreviewAllow viewing and downloading previews. Setting this to false will only show thumbnails and will also force downloadOriginal to false.requestApprovalRequest for approval.requestUploadAllow uploading new files, must be true when asset id's is not specified.containerIdContainer asset id which uploaded files are related to. Only relevant when requestUpload=true.importFolderPathfolderPath where files are uploaded. Required when requestUpload=true.notifyEmailEmail address to send notifications to when upload or approval is finished. Only relevant when requestUpload=true or requestApproval=true.sortClient setting, specify a comma-delimited list of fields to sort the results on. Follows the same behavior as sort in REST - search callviewModeClient setting. Possible values 'thumbnail', 'list' or 'mason'.thumbnailFieldsClient setting, array containing list of fieldnames for showing metadata in the thumbnail view.listviewFieldsClient setting, array containing list of fieldnames for showing metadata in the list view.filmstripFieldsClient setting, array containing list of fieldnames for showing metadata in the filmstrip view.thumbnailZoomLevelClient setting, thumbnail zoom level in the thumbnail view.listviewZoomLevelClient setting, thumbnail zoom level in the list view.filmstripZoomLevelClient setting, thumbnail zoom level in the filmstrip view.Returns object containing the authKey and links to different clients.

### RevokeAuthKeys

[](#revokeauthkeys)

Create an authKey in Elvis.

```
$revokeAuthKeys = Elvis::revokeAuthKeys($token, array($assetId));

```

ParameterDescriptionsessionIdSession ID returned by the login function.keyslist of authKeys.Returns an empty object if succesfull.

### Logout

[](#logout)

It is a good practice to close the session after you are done with your queries so it doesn't take API licences unnecessarily. You can use logout for this.

```
$logout = Elvis::logout($token);

```

ParameterDescriptionsessionIdSession ID returned by the login function.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~161 days

Recently: every ~224 days

Total

20

Last Release

1159d ago

Major Versions

1.0.1 → 2.0.02015-03-26

2.0.2 → 3.0.02016-11-09

3.0.5 → 4.0.02018-02-19

4.0.2 → v5.02020-09-15

v5.0.2 → v6.02021-05-18

PHP version history (2 changes)1.0.1PHP &gt;=5.4.0

v6.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6697fc2a4266c4d9a5526043fa45b172881bd09b5d1743751e6ae70f9104ee73?d=identicon)[lasleh](/maintainers/lasleh)

---

Top Contributors

[![lasselehtinen](https://avatars.githubusercontent.com/u/1290186?v=4)](https://github.com/lasselehtinen "lasselehtinen (94 commits)")

---

Tags

laravelelvisdam

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lasselehtinen-elvis/health.svg)

```
[![Health](https://phpackages.com/badges/lasselehtinen-elvis/health.svg)](https://phpackages.com/packages/lasselehtinen-elvis)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)[laravel-freelancer-nl/laravel-index-now

Alert search engines of content changes.

5212.1k](/packages/laravel-freelancer-nl-laravel-index-now)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
