承接 ayles-software/laravel-zoho-desk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ayles-software/laravel-zoho-desk

最新稳定版本:1.3.0

Composer 安装命令:

composer require ayles-software/laravel-zoho-desk

包简介

Laravel wrapper for Zoho Desk

README 文档

README

Zoho Desk Laravel provides an oauth2 client and sdk for Zoho Desk api.

Requirements

  • Laravel 6+
  • PHP 7.2.5+

Installation

Install via using composer

composer require ayles-software/laravel-zoho-desk

Setup

Publish the config.

php artisan vendor:publish --provider="AylesSoftware\ZohoDesk\ServiceProvider"

You now need to populate the config/zoho-desk.php file with the credentials for your Zoho integration. You can create new API keys here. Add the following variables to your .env file.

ZOHO_DESK_REDIRECT_URL=
ZOHO_DESK_CLIENT_ID=
ZOHO_DESK_CLIENT_SECRET=
ZOHO_DESK_ACCESS_TYPE=
ZOHO_DESK_ORGANISATION_ID=
ZOHO_DESK_BASE_URL=

The config file also contains scopes for Zoho. The access_type=offiline scope is required to obtain a new access token. Access tokens expire after 60 minutes. For more information on scopes try the documentation.

Migrations

This package uses ZohoDeskAccess model to manage access tokens. Run the migration to create this table.

php artisan migrate

OAuth flow

First you must authorize the application, this will require a controller and route to be setup. Once the application has been authorized then access to Zoho is self managed within this package. Once the access token expires, a new one will be request as needed.

ZohoOAuth::class will provide the OAuth flow and regeneration of the access token.

Example of Controller for authorization.

<?php

namespace App\Http\Controllers;

use AylesSoftware\ZohoDesk\ZohoOAuth;

class ZohoOAuthController extends Controller
{
    public function __invoke(ZohoOAuth $zohoOAuth)
    {
        return $zohoOAuth->flow();
    }
}

Usage

use AylesSoftware\ZohoDesk\Facades\ZohoDesk;

# create a ticket
# for more options see https://desk.zoho.com.au/support/APIDocument.do#Tickets#Tickets_Createaticket
$response = ZohoDesk::createTicket([
    'subject' => 'Support message - Test user',
    'description' => 'This is the body of the ticket',
    'departmentId' => '0000000000000000', // this can be found within ZohoDesk
    'email' => 'contact@email.com',
    'contact' => [
        'email' => 'contact@email.com',
        'firstName' => 'Benjamin',
    ],
]);

For more information see the API Documentation.

License

Zoho Desk Laravel is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 4.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固