zenichanin/freshdesk-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

zenichanin/freshdesk-laravel

最新稳定版本:0.3.0

Composer 安装命令:

composer require zenichanin/freshdesk-laravel

包简介

Laravel package for the Freshdesk API (v2)

README 文档

README

Build Status Scrutinizer Code Quality SensioLabsInsight Packagist

This is a service provider for interacting with the Freshdesk API v2 via the freshdesk-php-sdk in Laravel and Lumen applications.

Installation

To add this bundle to your app, use Composer.

Add mpclarkson/freshdesk-laravel to your composer.json file:

{
    "require": {
        "zenichanin/freshdesk-laravel": "dev-master"
    }
}

Then run:

composer update

You must then register the provider in your application.

Register the provider in the providers key in your config/app.php:

    'providers' => array(
        // ...
        Mpclarkson\Laravel\Freshdesk\FreshdeskServiceProvider::class,
    )

Then add the Freshdesk facade alias in the aliases key in your config/app.php:

    'aliases' => array(
        // ...
        'Freshdesk' => Mpclarkson\Laravel\Freshdesk\FreshdeskFacade::class,
    )

Configuration

To customize the configuration file, publish the package configuration using Artisan.

php artisan vendor:publish --provider="Mpclarkson\Laravel\Freshdesk\FreshdeskServiceProvider"

Set your configuration using environment variables in your .env file:

  • FRESHDESK_KEY

Read this article to find your API key: https://support.freshdesk.com/support/solutions/articles/215517-how-to-find-your-api-key

  • FRESHDESK_DOMAIN

The subdomain part of your Freshdesk organisation URL.

Accessing the Freshdesk API

In a controller you can access Freshdesk resource as follows:

//Contacts
$contacts = Freshdesk::contacts()->update($contactId, $data);

//Agents
$me = Freshdesk::agents()->current();

//Companies
$company = Freshdesk::companies()->create($data);

//Groups
$deleted = Freshdesk::groups()->delete($groupId);

//Tickets
$ticket = Freshdesk::tickets()->view($filters);

//Time Entries
$time = Freshdesk::timeEntries()->all($ticket['id']);

//Conversations
$ticket = Freshdesk::conversations()->note($ticketId, $data);

//Categories
$newCategory = Freshdesk::categories()->create($data);

//Forums
$forum = Freshdesk::forums()->create($categoryId, $data);

//Topics
$topics =Freshdesk::topics()->monitor($topicId, $userId);

//Comments
$comment = Freshdesk::comments()->create($forumId);

//Email Configs
$configs = Freshdesk::emailConfigs()->all();

//Products
$product = Freshdesk::products()->view($productId);

//Business Hours
$hours = Freshdesk::businessHours()->all();

//SLA Policy
$policies = Freshdesk::slaPolicies()->all();

Filtering

All GET requests accept an optional array $query parameter to filter results. For example:

//Page 2 with 50 results per page
$page2 = Freshdesk::forums()->all(['page' => 2, 'per_page' => 50]);

//Tickets for a specific customer
$tickets = Freshdesk::tickets()->view(['company_id' => $companyId]);

Please read the Freshdesk documentation for further information on filtering GET requests.

Contributing

This is a work in progress and PRs are welcome. Please read the contributing guide.

Author

The library was written and maintained by Matthew Clarkson from Hilenium.

References

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 41
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固