PHPackages                             optimacloud/zoho-laravel - 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. optimacloud/zoho-laravel

ActiveLibrary[API Development](/categories/api)

optimacloud/zoho-laravel
========================

Laravel Zoho API V3 Package

6.0.7(2y ago)03.3kMITPHPPHP ^8.1|^8.2

Since Mar 18Pushed 2y agoCompare

[ Source](https://github.com/optimacloud/zoho-laravel)[ Packagist](https://packagist.org/packages/optimacloud/zoho-laravel)[ Docs](https://github.com/optimacloud/zoho-laravel)[ RSS](/packages/optimacloud-zoho-laravel/feed)WikiDiscussions 6.x Synced 1mo ago

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

Zoho Laravel API V6 Package
===========================

[](#zoho-laravel-api-v6-package)

[![Packagist Version](https://camo.githubusercontent.com/a8e2d450d3d80420cc568061342a2bccd48b4af2e4ef855f7ebbfd64f95da22d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f7074696d61636c6f75642f7a6f686f2d6c61726176656c)](https://camo.githubusercontent.com/a8e2d450d3d80420cc568061342a2bccd48b4af2e4ef855f7ebbfd64f95da22d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f7074696d61636c6f75642f7a6f686f2d6c61726176656c)[![Packagist Downloads](https://camo.githubusercontent.com/333a76636a43f746351a5fc59e71b67c8e181ec84c64e53143682a0c419edc01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7074696d61636c6f75642f7a6f686f2d6c61726176656c)](https://camo.githubusercontent.com/333a76636a43f746351a5fc59e71b67c8e181ec84c64e53143682a0c419edc01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7074696d61636c6f75642f7a6f686f2d6c61726176656c)

This package used to integrate with the Zoho V6 Api CRM

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

[](#requirements)

- PHP &gt;= 8.0
- Laravel &gt;= 8.0

Registering a Zoho Client
-------------------------

[](#registering-a-zoho-client)

Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:

1. Visit this page [https://api-console.zoho.com/](https://api-console.zoho.com)
2. Click on `ADD CLIENT`.
3. Choose a `Self Client`.
4. Create grant token by providing the necessary scopes, time duration (the duration for which the generated token is valid) and Scope Description.
5. Your Client app would have been created and displayed by now.
6. Select the created OAuth client.
7. User this scope `aaaserver.profile.READ,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL` when you create the grant token.

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

[](#installation)

You can install the package via `composer require`:

```
composer require optimacloud/zoho-laravel
```

After installing the package you can publish the config file with:

```
php artisan vendor:publish --tag="zoho-laravel-config"
```

after that you need to create the OAuth client and get the credentials from Zoho by run the following 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_AUTH_FLOW_TYPE=grantToken
ZOHO_CLIENT_ID="Code from Client Secrit Section"
ZOHO_CLIENT_SECRET="Code from Client Secrit Section"
ZOHO_REDIRECT_URI="${APP_URL}/zoho/oauth2callback"
ZOHO_CURRENT_USER_EMAIL=admin@example.com
ZOHO_TOKEN="Code Generated from last step"

# available datacenters (USDataCenter, EUDataCenter, INDataCenter, CNDataCenter, AUDataCenter)
ZOHO_DATACENTER=USDataCenter
ZOHO_SANDBOX=true
```

After that you need to run the following command to add token and refresh token to your storage

```
php artisan zoho:grant
```

You can publish the config file with:

```
php artisan vendor:publish --tag="zoho-laravel-config"
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="zoho-laravel-migrations"
php artisan migrate
```

### Environments

[](#environments)

maybe in some cases you wish to enforce zoho to use one of zoho's environments, so you can go to `AppServiceProvider`and use `Zoho::useEnvironment()` method

```
Zoho::useEnvironment(EUDataCenter::DEVELOPER());
```

So that will override config settings.

Usage
-----

[](#usage)

To retrieve all modules from Zoho.

```
use Optimacloud\Zoho\ZohoManager;

$response = ZohoManager::make(self::TESTING_MODULE);
$modules  = $response->getAllModules();
```

Models can be used like this:-
------------------------------

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

Available only starting from **v1.1.0**

add `Zohoable` as extended class like this:-

```
use Optimacloud\Zoho\Zohoable;
use Optimacloud\Zoho\ZohoManager;

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 ZohoManager::make('Payments')
                            ->where('PaymentID', $this->payment_id)
                            ->andWhere('Order_ID', $this->order_id)
                            ->getCriteria();
    }

    public function zohoMandatoryFields() {
        // you should return array of mandatory fields to create module from this model
        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 Optimacloud\Zoho\ZohoManager;

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

// OR

$leads = ZohoManager::make('Leads');

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

#### UPDATE

[](#update)

```
$record = new Record();
$record->setId('3582074000002383003');

// Set value as field
$record->addFieldValue(Leads::FirstName(), 'Updated');
$record->addFieldValue(Leads::LastName(), 'Record');

// Set value as key value
$lead->setKeyValue('Phone', '5555555555552');

// Then call update() method
$response = $leads->update($record);
```

#### CREATE

[](#create)

```
// create the record into zoho crm then get the created instance data
$response = $leads->create([
    'First_Name' => 'Amr',
    'Last_Name' => 'Emad',
    'Email' => 'test@optimacloud.com',
    'Phone' => '012345678910',
]);
```

#### DELETE

[](#delete)

```
// delete record by its id
$lead = $leads->delete('3582074000002383003');
```

#### SEARCH

[](#search)

##### Word

[](#word)

```
use Optimacloud\Zoho\ZohoManager;

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

##### Phone

[](#phone)

```
use Optimacloud\Zoho\ZohoManager;

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

##### Email

[](#email)

```
use Optimacloud\Zoho\ZohoManager;

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

##### Criteria

[](#criteria)

```
use Optimacloud\Zoho\ZohoManager;

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

##### Custom

[](#custom)

```
use Optimacloud\Zoho\ZohoManager;

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

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

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

```

Support
-------

[](#support)

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

+2-010-1144-1444

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/optimacloud/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [aemaddin](https://github.com/asciisd)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68% 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 ~5 days

Total

8

Last Release

749d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/133e7275d57b3053e870a66332b987ae0be489e1c61938f22196d42cf19d2be9?d=identicon)[ekoukltd](/maintainers/ekoukltd)

---

Top Contributors

[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (51 commits)")[![cannycookie](https://avatars.githubusercontent.com/u/500822?v=4)](https://github.com/cannycookie "cannycookie (7 commits)")[![upsmod](https://avatars.githubusercontent.com/u/120280065?v=4)](https://github.com/upsmod "upsmod (6 commits)")[![jaketoolson](https://avatars.githubusercontent.com/u/612332?v=4)](https://github.com/jaketoolson "jaketoolson (5 commits)")[![papoms](https://avatars.githubusercontent.com/u/1764001?v=4)](https://github.com/papoms "papoms (3 commits)")[![Dorsone](https://avatars.githubusercontent.com/u/84617193?v=4)](https://github.com/Dorsone "Dorsone (1 commits)")[![quangtam](https://avatars.githubusercontent.com/u/6047178?v=4)](https://github.com/quangtam "quangtam (1 commits)")[![bfiessinger](https://avatars.githubusercontent.com/u/41627893?v=4)](https://github.com/bfiessinger "bfiessinger (1 commits)")

---

Tags

laravelcrmZohooptimacloud

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/optimacloud-zoho-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/optimacloud-zoho-laravel/health.svg)](https://phpackages.com/packages/optimacloud-zoho-laravel)
```

###  Alternatives

[asciisd/zoho-v3

Laravel Zoho API V3 Package

2121.3k](/packages/asciisd-zoho-v3)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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