PHPackages                             developer-kareem-elsharkawy/zoho - 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. developer-kareem-elsharkawy/zoho

ActiveLibrary[API Development](/categories/api)

developer-kareem-elsharkawy/zoho
================================

A fork of Asciisd Zoho, providing an elegant and easy way to communicate with Zoho CRM.

v2.0.7(1y ago)07MITPHPPHP ^8.1

Since Jan 10Pushed 1y agoCompare

[ Source](https://github.com/sharq-labs/zoho)[ Packagist](https://packagist.org/packages/developer-kareem-elsharkawy/zoho)[ RSS](/packages/developer-kareem-elsharkawy-zoho/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (33)Used By (0)

Zoho
====

[](#zoho)

[![Latest Version on Packagist](https://camo.githubusercontent.com/eb12fa39bcbd5cd4d914088245e91fb7c4c89d7b59630e49642d8e777be6eed4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617363696973642f7a6f686f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/zoho)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/ed7cb2d94b016668ac9015a778dc01f2514fb030dd5654f25f7111d8a8ac0224/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617363696973642f7a6f686f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/zoho)

This package used to integrate with the new Zoho CRM

> For a new package please visit - [ZohoV3](https://github.com/asciisd/zoho-v3)

Requirements
------------

[](#requirements)

- Get yourself a [Zoho CRM account](https://www.zoho.com/crm/).
- [Register your application](https://www.zoho.com/crm/developer/docs/api/register-client.html)
- PHP &gt;= 7.2
- Laravel &gt;= 6.\*

Installation
------------

[](#installation)

Add Zoho CRM to your composer file via the `composer require` command:

```
$ composer require asciisd/zoho
```

Or add it to `composer.json` manually:

```
"require": {
    "asciisd/zoho": "^1.0"
}
```

Zoho CRM service providers will be automatically registered using Laravel's auto-discovery feature.

Configuration
-------------

[](#configuration)

The default configuration settings set in `config/zoho.php`. Copy this file to your own config directory to modify the values. You can publish the config using this command:

```
$ php artisan zoho:install
```

You'll need to add the following variables to your .env file. Use the credentials previously obtained registering your application.

```
ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REDIRECT_URI=
ZOHO_CURRENT_USER_EMAIL=
```

> **please note** that for `ZOHO_REDIRECT_URI` you need to put your `app_url` as it is in `.env` file suffixed by `/zoho/oauth2callback`for ex. `https://asciisd.com/zoho/oauth2callback`

#### Then, follow the next steps:

[](#then-follow-the-next-steps)

1. Go to [Zoho CRM Developer Console](https://accounts.zoho.com/developerconsole).
2. ADD CLIENT `Server-based Applications`.
3. Enter Client Name `Any name you want`
4. Enter Homepage URL `your base home url`
5. Enter Authorized Redirect URIs `config('app.url') . /zoho/oauth2callback`
6. Go to your project location on terminal and enter ```
    php artisan zoho:authentication
    ```
7. Copy the generated link and past it in the browser to complete the oAuth process.

**Now Zoho CRM is ready to use.**

Testing
-------

[](#testing)

before testing make sure to create file ZCRMClientLibrary.log on

```
tests/Fixture/Storage/oauth/logs/ZCRMClientLibrary.log

```

and put your zcrm\_oauthtokens.txt on

```
tests/Fixture/Storage/oauth/tokens/zcrm_oauthtokens.txt

```

finally put your Env keys

```
ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REDIRECT_URI=
ZOHO_CURRENT_USER_EMAIL=
```

How to use
==========

[](#how-to-use)

use **ZOHO** Facade like this

```
use Asciisd\Zoho\Facades\ZohoManager;

// we can now deals with leads module
$leads = ZohoManager::useModule('Leads');
```

this will return an instance of **ZohoModules**

Model Can be used like this:-
-----------------------------

[](#model-can-be-used-like-this-)

Available only starting from **v1.1.0**

add `Zohoable` as extended class like this:-

```
use Asciisd\Zoho\Zohoable;
use Asciisd\Zoho\CriteriaBuilder;

class Invoice extends Zohoable {

    // this is your Zoho module API Name
    protected $zoho_module_name = 'Payments';

    public function searchCriteria(){
        // you should return string of criteria that you want to find current record in crm with.
        //EX:
        return CriteriaBuilder::where('PaymentID', $this->payment_id)
                              ->andWhere('Order_ID', $this->order_id)
                              ->toString();
    }

    public function zohoMandatoryFields() {
        // you should return array of mandatory fields to create module from this model
        // EX:
        return ['Base_Currency' => $this->currency];
    }
}
```

so now you can use invoice like this

```
$invoice = \App\Invoice::find(1);

// to check if has zoho id stored on local database or not
$invoice->hasZohoId();

// to return the stored zoho id
$invoice->zohoId();

// that will search on zoho with provided criteria to find the record and associated your model with returned id if exist
// if you provided an `id` that will be used instead of searching on Zoho
$invoice->createOrUpdateZohoId($id = null);

// you can also send current model to zoho
// that wil use `zohoMandatoryFields` method to Serialize model to zohoObject
// Also you can pass additional fields as array to this method
$invoice->createAsZohoable($options = []);
```

**Note:** To use the Invoice like this, you must have the `invoices` table in your database just like you would for any Laravel model. This allows you to save data to the database and also be able to link it to the `zohos` table and use all the functions in `Zohoable`. Use the CRUD functions below if you do not intend to use the Zohoable model this way.

CRUD Can be used like this:-
----------------------------

[](#crud-can-be-used-like-this-)

#### READ

[](#read)

```
use Asciisd\Zoho\Facades\ZohoManager;

// we can now deals with leads module
$leads = ZohoManager::useModule('Leads');

// find record by it's ID
$lead = $leads->getRecord('3582074000002383003');
```

#### UPDATE

[](#update)

```
// find record by it's ID
$lead = $leads->getRecord('3582074000002383003');

// Set field with new value
$lead->setFieldValue('Last_Name', 'Ahmed');

// Then call update() method
$lead = $lead->update()->getData();
```

#### CREATE

[](#create)

```
// initiating a new empty instance of leads
$record = $leads->getRecordInstance();

// fill this instance with data
$record->setFieldValue('First_Name', 'Amr');
$record->setFieldValue('Last_Name', 'Emad');
$record->setFieldValue('Email', 'test@asciisd.com');
$record->setFieldValue('Phone', '012345678910');

// create the record into zoho crm then get the created instance data
$lead = $record->create()->getData();
```

#### DELETE

[](#delete)

```
// find record by it's ID
$lead = $leads->getRecord('3582074000002383003');

$lead->delete();
```

#### SEARCH

[](#search)

##### Word

[](#word)

```
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByWord('word to be searched');
$first_record = $records[0];
```

##### Phone

[](#phone)

```
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByPhone('12345678910');
$first_record = $records[0];
```

##### Email

[](#email)

```
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByEmail('nobody@asciisd.com');
$first_record = $records[0];
```

##### Criteria

[](#criteria)

```
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByCriteria('(City:equals:NY) and (State:equals:Alden)');
$first_record = $records[0];
```

##### Custom

[](#custom)

```
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')
                    ->where('City', 'NY')
                    ->andWhere('State','Alden')
                    ->search();

$first_record = $records[0];
```

you can also make CriteriaBuilder like this

```
use Asciisd\Zoho\CriteriaBuilder;
use Asciisd\Zoho\Facades\ZohoManager;

$builder = CriteriaBuilder::where('City', 'NY')->andWhere('State','Alden')->startsWith('City', 'N');
ZohoManager::useModule('Leads')->searchRecordsByCriteria($builder->toString());
```

International Versions
----------------------

[](#international-versions)

If you're using zoho.com, you don't have to change anything.

If you're using zoho.eu, add to `.env`:

```
ZOHO_ACCOUNTS_URL=https://accounts.zoho.eu
ZOHO_API_BASE_URL=www.zohoapis.eu

```

If you're using zoho.com.cn, add to `.env`:

```
ZOHO_ACCOUNTS_URL=https://accounts.zoho.com.cn
ZOHO_API_BASE_URL=www.zohoapis.com.cn

```

License
-------

[](#license)

[MIT License](https://opensource.org/licenses/MIT). Copyright (c) 2020, Asciisd

Support
-------

[](#support)

Contact:
[asciisd.com](https://asciisd.com)

+2-010-1144-1444

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 89.7% 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 ~58 days

Recently: every ~193 days

Total

31

Last Release

557d ago

Major Versions

v0.0.5 → v1.0.02020-04-24

v1.2.10 → v2.0.02022-09-18

PHP version history (5 changes)v0.0.1PHP ^7.1.3

v1.0.0PHP ^7.2

v1.2.2PHP ^7.2|^8.0

v2.0.0PHP ^7.2|^8.0|^8.1

v2.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/be48a6126da311a8ee64e3b32e85985e3878df083256f370b6b82318783e91fe?d=identicon)[developer-kareem-elsharkawy](/maintainers/developer-kareem-elsharkawy)

---

Top Contributors

[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (70 commits)")[![sharq-labs](https://avatars.githubusercontent.com/u/108046720?v=4)](https://github.com/sharq-labs "sharq-labs (3 commits)")[![izorwebid](https://avatars.githubusercontent.com/u/1658024?v=4)](https://github.com/izorwebid "izorwebid (2 commits)")[![ibmgeniuz](https://avatars.githubusercontent.com/u/64996874?v=4)](https://github.com/ibmgeniuz "ibmgeniuz (1 commits)")[![moghwan](https://avatars.githubusercontent.com/u/2495180?v=4)](https://github.com/moghwan "moghwan (1 commits)")[![stefnats](https://avatars.githubusercontent.com/u/1174473?v=4)](https://github.com/stefnats "stefnats (1 commits)")

---

Tags

laravelcrmZoho

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/developer-kareem-elsharkawy-zoho/health.svg)

```
[![Health](https://phpackages.com/badges/developer-kareem-elsharkawy-zoho/health.svg)](https://phpackages.com/packages/developer-kareem-elsharkawy-zoho)
```

###  Alternatives

[asciisd/zoho

Asciisd Zoho provide an elegant and easy way to communicate with Zoho CRM.

3751.9k](/packages/asciisd-zoho)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)[davispeixoto/laravel5-salesforce

Laravel 5 Salesforce Force.com PHP Toolkit port

47142.8k1](/packages/davispeixoto-laravel5-salesforce)[asciisd/zoho-v3

Laravel Zoho API V3 Package

2121.3k](/packages/asciisd-zoho-v3)

PHPackages © 2026

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