PHPackages                             clystnet/vtiger - 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. clystnet/vtiger

AbandonedArchivedLaravel[API Development](/categories/api)

clystnet/vtiger
===============

Package to run Vtiger Webservice API

1.6.1(5y ago)62.1k11MITPHPPHP &gt;=5.6.0

Since Apr 5Pushed 5y agoCompare

[ Source](https://github.com/Clystnet/Vtiger)[ Packagist](https://packagist.org/packages/clystnet/vtiger)[ Docs](https://github.com/Clystnet/Vtiger)[ RSS](/packages/clystnet-vtiger/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (1)Versions (21)Used By (0)

This package is deprecated
==========================

[](#this-package-is-deprecated)

### Here at Clystnet We no longer maintain the Open Source version of this package. We do however maintain our in house version of this package which you talk to us about using by contacting .

[](#here-at-clystnet-we-no-longer-maintain-the-open-source-version-of-this-package-we-do-however-maintain-our-in-house-version-of-this-package-which-you-talk-to-us-about-using-by-contacting-salesclystnetcom)

Vtiger (Laravel 5 Package)
==========================

[](#vtiger-laravel-5-package)

[![All Contributors](https://camo.githubusercontent.com/f7e7ee5949a35d448797601f9193f3e6b8108dc258029dad8457e109c52b4a41/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d342d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](#contributors-)

Use the Vtiger webservice (REST) API from within Laravel for the following operations.

- Create
- Retrieve
- Update
- Delete
- Search
- Query
- Describe

See [Third Party App Integration (REST APIs)](http://community.vtiger.com/help/vtigercrm/developers/third-party-app-integration.html)

Installation, Configuration and Usage
-------------------------------------

[](#installation-configuration-and-usage)

### Installing

[](#installing)

1. In order to install the Vtiger package in your Laravel project, just run the composer require command from your terminal:

    ```
    composer require "clystnet/vtiger ^1.4"

    ```

    > *If you are using Laravel &gt;= 5.5 you don’t need to do steps 2 and 3.*
2. Then in your config/app.php add the following to the providers array:

    ```
    Clystnet\Vtiger\VtigerServiceProvider::class,

    ```
3. In the same config/app.php add the following to the aliases array:

    ```
    'Vtiger' => Clystnet\Vtiger\Facades\Vtiger::class,

    ```
4. Publish the configuration file:

    ```
    php artisan vendor:publish --tag="vtiger"

    ```

### Configuration

[](#configuration)

- In Vtiger, create a new or select an existing user.
- Under *User Advanced Options* make note of the *username* and *access key*.
- In your application, edit *config/vtiger.php* and replace the following array values
    - Set the url to the https://{DOMAIN\_NAME}/webservice.php
    - Set the username and accesskey with your CRM username and access key.
    - Set persistconnection to false if you want a fresh login with each request

        keyvalueurlusernameAPIaccesskeyirGsy9HB0YOZdEApersistconnectiontruemax\_retries10

> Because I've experienced problems getting the sessionid from the CRM when multiple users are accessing the CRM at the same time, the solution was to store the sessionid into a file within Laravel application. Instead of getting the token from the database for each request using the webservice API, a check is made against the expiry time in the file. If the expiry time has expired, a token is requested from the CRM and file is updated with the new token and updated expiry time.

### Usage

[](#usage)

In your controller include the Vtiger package

```
use Vtiger;
```

#### Create

[](#create)

To insert a record into the CRM, first create an array of data to insert. Don't forget the added the id of the `assigned_user_id` (i.e. '4x12') otherwise the insert will fail as `assigned_user_id` is a mandatory field.

```
$data = array(
    'assigned_user_id' => '',
);
```

To do the actual insert, pass the module name along with the json encoded array to the *create* function.

```
Vtiger::create($MODULE_NAME, json_encode($data));
```

#### Retrieve

[](#retrieve)

To retrieve a record from the CRM, you need the id of the record you want to find (i.e. '4x12').

```
$id = '4x12';

$obj = Vtiger::retrieve($id);

// do someting with the result
var_dump($obj);
```

#### Update

[](#update)

The easiest way to update a record in the CRM is to retrieve the record first.

```
$id = '4x12';

$obj = Vtiger::retrieve($id);
```

Then update the object with updated data.

```
$obj->result->field_name = 'Your new value';

$update = Vtiger::update($obj->result);
```

#### Delete

[](#delete)

To delete a record from the CRM, you need the id of the record you want to delete (i.e. '4x12').

```
$id = '4x12';

$obj = Vtiger::retrieve($id);

// do someting with the result
var_dump($obj);
```

#### Lookup

[](#lookup)

This function uses the Vtiger Lookup API endpoint to search for a single piece of information within multiple columns of a Vtiger module. This function is often multitudes faster than the search function.

```
    $dataType = 'phone';
    $phoneNumber = '1234567890';
    $module = 'Leads';
    $columns = ['phone', 'fax']; //Must be an array

    Vtiger::lookup($dataType, $phoneNumber, $module, $columns);
```

#### Search

[](#search)

This function is a sql query builder wrapped around the query function. Accepts instance of laravels QueryBuilder.

```
$query = DB::table('Leads')->select('id', 'firstname', 'lastname')->where('firstname', 'John');

$obj = Vtiger::search('Leads', $query);

//loop over result
foreach($obj->result as $result) {
    // do something
}
```

By default the function will quote but not escape your inputs, if you wish for your data to not be quoted, set the 3rd paramater to false like so:

```
$obj = Vtiger::search('Leads', $query, false);
```

Also keep in mind that Vtiger has several limitations on it's sql query capabilities. You can not use conditional grouping i.e "where (firstname = 'John' AND 'lastname = 'Doe') OR (firstname = 'Jane' AND lastname = 'Smith') will fail.

#### Query

[](#query)

To use the [Query Operation](http://community.vtiger.com/help/vtigercrm/developers/third-party-app-integration.html#query-operation), you first need to create a SQL query.

```
$query = "SELECT * FROM ModuleName;";
```

Then run the query...

```
$obj = Vtiger::query($query);

//loop over result
foreach($obj->result as $result) {
    // do something
}
```

### Describe

[](#describe)

To describe modules in the CRM run this with the module name

```
$moduleDescription = (Vtiger:describe("Contacts"))->result;
```

Contributing
------------

[](#contributing)

Please report any issue you find in the issues page. Pull requests are more than welcome.

Authors
-------

[](#authors)

- **Adam Godfrey** - [Clystnet](https://www.clystnet.com)
- **Chris Pratt** - [Clystnet](https://www.clystnet.com)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

Contributors ✨
--------------

[](#contributors-)

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

  [![](https://avatars0.githubusercontent.com/u/14102774?v=4)
**Ahmad Syamim**](https://www.syamim.ascube.net/)
[💻](https://github.com/Clystnet/Vtiger/commits?author=ahmadsyamim "Code") [![](https://avatars0.githubusercontent.com/u/1725282?v=4)
**Clyde Cox**](https://github.com/cjcox17)
[💻](https://github.com/Clystnet/Vtiger/commits?author=cjcox17 "Code") [📖](https://github.com/Clystnet/Vtiger/commits?author=cjcox17 "Documentation") [![](https://avatars2.githubusercontent.com/u/40233133?v=4)
**Christopher Pratt**](https://www.clystnet.com/)
[💻](https://github.com/Clystnet/Vtiger/commits?author=Chris-Pratt-Clystnet "Code") [📖](https://github.com/Clystnet/Vtiger/commits?author=Chris-Pratt-Clystnet "Documentation") [![](https://avatars1.githubusercontent.com/u/6408143?v=4)
**adam-godfrey**](https://github.com/adam-godfrey)
[💻](https://github.com/Clystnet/Vtiger/commits?author=adam-godfrey "Code") [📖](https://github.com/Clystnet/Vtiger/commits?author=adam-godfrey "Documentation") This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~56 days

Recently: every ~188 days

Total

16

Last Release

2160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21ed9273b3b9880b30dcfcee11d0b96dfd6cbe8c5eb96dcff05d70e2681e5682?d=identicon)[Clystnet](/maintainers/Clystnet)

---

Top Contributors

[![Chris-Pratt-Clystnet](https://avatars.githubusercontent.com/u/40233133?v=4)](https://github.com/Chris-Pratt-Clystnet "Chris-Pratt-Clystnet (21 commits)")[![adam-godfrey](https://avatars.githubusercontent.com/u/6408143?v=4)](https://github.com/adam-godfrey "adam-godfrey (14 commits)")[![cjcox17](https://avatars.githubusercontent.com/u/1725282?v=4)](https://github.com/cjcox17 "cjcox17 (12 commits)")[![allcontributors[bot]](https://avatars.githubusercontent.com/in/23186?v=4)](https://github.com/allcontributors[bot] "allcontributors[bot] (10 commits)")[![ahmadsyamim](https://avatars.githubusercontent.com/u/14102774?v=4)](https://github.com/ahmadsyamim "ahmadsyamim (1 commits)")

---

Tags

apilaravelvtigerlaravelvtiger

### Embed Badge

![Health badge](/badges/clystnet-vtiger/health.svg)

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M923](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[flat3/lodata

OData v4.01 Producer for Laravel

99346.1k](/packages/flat3-lodata)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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