You can install the package via composer:
composer require alexanderpoellmann/laravel-zendesk
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-zendesk-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-zendesk-config"
This is the contents of the published config file:
return [
//
];
Don't forget to add the following to your config/services.php
:
return [
'zendesk' => [
'subdomain' => env('ZENDESK_SUBDOMAIN', null),
'username' => env('ZENDESK_USERNAME', null),
'token' => env('ZENDESK_TOKEN', null)
],
];
See also https://github.com/zendesk/zendesk_api_client_php/blob/master/README.md.
// Create or update a user
$user = Zendesk::createOrUpdateUser(
firstName: 'John',
lastName: 'Doe',
email: 'john@example.com',
);
ray($user);
// Create an anonymous request
$request = Zendesk::createAnonymousRequest(
firstName: 'John',
lastName: 'Doe',
email: 'john@example.com',
recipientEmailAddress: 'support@example.com',
subject: 'Help!',
body: '"My printer is on fire!',
);
ray($request);
// Create a ticket directly
$ticket = Zendesk::authenticate()->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'
]);
ray($ticket);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.