Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

A Laravel Zendesk library for integrating with the Zendesk API

License

Notifications You must be signed in to change notification settings

Superbalist/laravel-zendesk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-zendesk

A Laravel Zendesk library for integrating with the Zendesk API

Author StyleCI Software License Packagist Version Total Downloads

This package provides a Laravel service provider and facade for the zendesk/zendesk_api_client_php package.

Installation

composer require superbalist/laravel-zendesk

Register the service provider in app.php

'providers' => array(
    'Superbalist\Zendesk\ZendeskServiceProvider',
)

Register the facade in app.php

'aliases' => array(
    'Zendesk' => 'Superbalist\Zendesk\ZendeskFacade',
)

Create a services.php config file.

<?php

return array(

    'zendesk' => array(
        'subdomain' => '[[your zendesk subdomain]]',
        'username' => '[[your zendesk username]]',
        'token' => '[[your zendesk api token]]',
    ),

);

Usage

Please see https://github.com/zendesk/zendesk_api_client_php for full documentation on the core API.

All functions provided by the core API are available behind the Zendesk facade in Laravel.

use Zendesk;

// get all tickets
$zendesk = Zendesk::tickets()->findAll();

// create a new ticket
$ticket = Zendesk::tickets()->create([
    'subject' => 'The quick brown fox jumps over the lazy dog',
    'comment' => [
        'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
                  'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
    ],
    'priority' => 'normal'
]);