PHPackages                             codebar-ag/laravel-zendesk - 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. codebar-ag/laravel-zendesk

ActiveLibrary[API Development](/categories/api)

codebar-ag/laravel-zendesk
==========================

Zendesk integration with Laravel

v13.0.0(3mo ago)03.4k[2 PRs](https://github.com/codebar-ag/laravel-zendesk/pulls)MITPHPPHP 8.3.\*|8.4.\*|8.5.\*CI passing

Since Jul 8Pushed 1mo agoCompare

[ Source](https://github.com/codebar-ag/laravel-zendesk)[ Packagist](https://packagist.org/packages/codebar-ag/laravel-zendesk)[ Docs](https://github.com/codebar-ag/laravel-zendesk)[ RSS](/packages/codebar-ag-laravel-zendesk/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (45)Versions (28)Used By (0)

[![](https://camo.githubusercontent.com/d2389c9e1d78f3bb88339acfe21f24cd0ec37968fccf5d9885a4ef61ffabc37d/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532305a656e6465736b2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f64656261722d61672532466c61726176656c2d7a656e6465736b267061747465726e3d63697263756974426f617264267374796c653d7374796c655f32266465736372697074696f6e3d412b4c61726176656c2b5a656e6465736b2b696e746567726174696f6e2e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313530707826696d616765733d686f6d65267769647468733d35303026686569676874733d353030)](https://camo.githubusercontent.com/d2389c9e1d78f3bb88339acfe21f24cd0ec37968fccf5d9885a4ef61ffabc37d/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532305a656e6465736b2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f64656261722d61672532466c61726176656c2d7a656e6465736b267061747465726e3d63697263756974426f617264267374796c653d7374796c655f32266465736372697074696f6e3d412b4c61726176656c2b5a656e6465736b2b696e746567726174696f6e2e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313530707826696d616765733d686f6d65267769647468733d35303026686569676874733d353030)

[![Latest Version on Packagist](https://camo.githubusercontent.com/16aef10a0d988b95db88095741ccd23fa15fba60c7272fc13fbb6d6c87f45a98/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656261722d61672f6c61726176656c2d7a656e6465736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codebar-ag/laravel-zendesk)[![Total Downloads](https://camo.githubusercontent.com/76b0273bb60e963d25ffea1f959181277af7bba23d0414e17bd7dd0d8ae16722/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656261722d61672f6c61726176656c2d7a656e6465736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codebar-ag/laravel-zendesk)[![GitHub-Tests](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/run-tests.yml)[![GitHub Code Style](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/fix-php-code-style-issues.yml)[![PHPStan](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/phpstan.yml)[![Dependency Review](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/dependency-review.yml)

This package was developed to give you a quick start to creating tickets via the Zendesk API.

💡 What is Zendesk?
------------------

[](#-what-is-zendesk)

Zendesk is a cloud-based help desk management solution offering customizable tools to build customer service portals, knowledge base and online communities.

🛠 Requirements
--------------

[](#-requirements)

PackagePHPLaravelZendeskv13.0^8.3 - ^8.513.x✅v12.0^8.2 - ^8.412.x✅v11.0^8.2 - ^8.311.x✅v1.0^8.210.x✅Authentication
--------------

[](#authentication)

The currently supported authentication methods are:

MethodSupportedBasic Auth✅API token✅OAuth access token❌⚙️ Installation
---------------

[](#️-installation)

You can install the package via composer:

```
composer require codebar-ag/laravel-zendesk
```

Optionally, you can publish the config file with:

```
php artisan vendor:publish --provider="CodebarAg\Zendesk\ZendeskServiceProvider" --tag="config"
```

You can add the following env variables to your `.env` file:

```
ZENDESK_SUBDOMAIN=your-subdomain #required
ZENDESK_AUTHENTICATION_METHOD=token #default ['basic', 'token']
ZENDESK_EMAIL_ADDRESS=test@example.com #required
ZENDESK_API_TOKEN=your-api-token #required only for token authentication
ZENDESK_API_PASSWORD=your-password #required only for basic authentication
```

`Note: We handle base64 encoding for you so you don't have to encode your credentials.`

You can retrieve your API token from your [Zendesk Dashboard](https://developer.zendesk.com/api-reference/introduction/security-and-auth/)

Usage
-----

[](#usage)

To use the package, you need to create a ZendeskConnector instance.

```
use CodebarAg\Zendesk\ZendeskConnector;
...

$connector = new ZendeskConnector();
```

### Requests

[](#requests)

The following requests are currently supported:

RequestPHP classSupportedList tickets`AllTicketsRequest`✅Count tickets`CountTicketsRequest`✅Get ticket`SingleTicketRequest`✅Create ticket`CreateSingleTicketRequest`✅Create attachment`CreateAttachmentRequest`✅### Responses

[](#responses)

The following responses are currently supported for retrieving the response body:

Response MethodsDescriptionSupportedbodyReturns the HTTP body as a string✅jsonRetrieves a JSON response body and json\_decodes it into an array.✅objectRetrieves a JSON response body and json\_decodes it into an object.✅collectRetrieves a JSON response body and json\_decodes it into a Laravel collection. **Requires illuminate/collections to be installed.**✅dtoConverts the response into a DTO. This package provides DTOs for the requests above; Saloon also allows custom DTOs.✅See  for more information.

### Enums

[](#enums)

We provide enums for the following values:

EnumValuesTicketPriority'urgent', 'high', 'normal', 'low'TicketType'incident', 'problem', 'question', 'task'MalwareScanResult'malware\_found', 'malware\_not\_found', 'failed\_to\_scan', 'not\_scanned'`Note: When using the dto method on a response, the enum values will be converted to their respective enum class.`

### Zendesk API and DTO coverage

[](#zendesk-api-and-dto-coverage)

Official ticket JSON is documented in the [Zendesk Tickets API](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/). [`SingleTicketDTO`](src/Dto/Tickets/SingleTicketDTO.php) maps a large subset of fields returned by Zendesk; it is not guaranteed to include every property the API may return. For example, the docs show `custom_status_id` and `generated_timestamp` on ticket objects; those keys are not mapped on `SingleTicketDTO` today.

### DTOs

[](#dtos)

We provide DTOs for the following:

DTOPHP classAttachmentDTO`CodebarAg\Zendesk\Dto\Tickets\Attachments\AttachmentDTO`ThumbnailDTO`CodebarAg\Zendesk\Dto\Tickets\Attachments\ThumbnailDTO`UploadDTO`CodebarAg\Zendesk\Dto\Tickets\Attachments\UploadDTO`CommentDTO`CodebarAg\Zendesk\Dto\Tickets\Comments\CommentDTO`AllTicketsDTO`CodebarAg\Zendesk\Dto\Tickets\AllTicketsDTO`CountTicketsDTO`CodebarAg\Zendesk\Dto\Tickets\CountTicketsDTO`SingleTicketDTO`CodebarAg\Zendesk\Dto\Tickets\SingleTicketDTO``Note: This is the preferred way to work with requests and responses. You can still use the json, object, and collect methods, and pass arrays into requests where supported.`

### Examples

[](#examples)

#### Create a ticket

[](#create-a-ticket)

```
use CodebarAg\Zendesk\Requests\CreateSingleTicketRequest;
use CodebarAg\Zendesk\Dto\Tickets\SingleTicketDTO;
use CodebarAg\Zendesk\Dto\Tickets\Comments\CommentDTO;
use CodebarAg\Zendesk\Enums\TicketPriority;
...

$ticketResponse = $connector->send(
    new CreateSingleTicketRequest(
        SingleTicketDTO::fromArray([
            'comment' => CommentDTO::fromArray([
                'body' => 'The smoke is very colorful.',
            ]),
            'priority' => TicketPriority::URGENT,
            "subject" => "My printer is on fire!",
            "custom_fields" => [
                [
                    "id" => 12345678910111,
                    "value" => "Your custom field value"
                ],
                [
                    "id" => 12345678910112,
                    "value" => "Your custom field value 2"
                ],
            ],
        ])
    )
);

$ticket = $ticketResponse->dto();
```

#### List all tickets

[](#list-all-tickets)

```
use CodebarAg\Zendesk\Requests\AllTicketsRequest;
...

$listTicketResponse = $connector->send(new AllTicketsRequest());
$listTicketResponse->dto();
```

#### Count all tickets

[](#count-all-tickets)

```
use CodebarAg\Zendesk\Requests\CountTicketsRequest;
...

$countTicketResponse = $connector->send(new CountTicketsRequest());
$countTicketResponse->dto();
```

#### Get a ticket

[](#get-a-ticket)

```
use CodebarAg\Zendesk\Requests\SingleTicketRequest;
...

$ticketId = 1;

$ticketResponse = $connector->send(new SingleTicketRequest($ticketId));
$ticketResponse->dto();
```

#### Upload an attachment

[](#upload-an-attachment)

```
use CodebarAg\Zendesk\Requests\CreateAttachmentRequest;
use CodebarAg\Zendesk\Requests\CreateSingleTicketRequest;
use CodebarAg\Zendesk\Dto\Tickets\SingleTicketDTO;
use CodebarAg\Zendesk\Dto\Tickets\Comments\CommentDTO;
use Illuminate\Support\Facades\Storage;

$uploadResponse = $connector->send(
    new CreateAttachmentRequest(
        fileName: 'someimage.png',
        mimeType: Storage::disk('local')->mimeType('public/someimage.png'),
        stream: Storage::disk('local')->readStream('public/someimage.png')
    )
);

$token = $uploadResponse->dto()->token;

$ticketResponse = $connector->send(
    new CreateSingleTicketRequest(
        SingleTicketDTO::fromArray([
            'comment' => CommentDTO::fromArray([
                ...
                'uploads' => [
                    $token,
                ],
            ]),
        ])
    )
);

$ticket = $ticketResponse->dto();
```

🚧 Testing
---------

[](#-testing)

Copy your own phpunit.xml-file.

```
cp phpunit.xml.dist phpunit.xml
```

Run the tests:

```
./vendor/bin/pest
```

📝 Changelog
-----------

[](#-changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent changes.

✏️ Contributing
---------------

[](#️-contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

```
composer test
```

### Code Style

[](#code-style)

```
./vendor/bin/pint
```

🧑‍💻 Security Vulnerabilities
----------------------------

[](#‍-security-vulnerabilities)

Please review [our security policy](.github/SECURITY.md) on reporting security vulnerabilities.

🙏 Credits
---------

[](#-credits)

- [Sebastian Bürgin-Fix](https://github.com/StanBarrows)
- [All Contributors](../../contributors)
- [Skeleton Repository from Spatie](https://github.com/spatie/package-skeleton-laravel)
- [Laravel Package Training from Spatie](https://spatie.be/videos/laravel-package-training)
- [Laravel Saloon by Sam Carré](https://github.com/Sammyjo20/Saloon)

🎭 License
---------

[](#-license)

The MIT License (MIT). Please have a look at [License File](LICENSE.md) for more information.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~59 days

Recently: every ~3 days

Total

18

Last Release

92d ago

Major Versions

v1.5 → v2.02024-02-07

v2.0 → v11.02024-02-21

v11.0.1 → v12.02025-03-03

v11.1.0 → v12.0.12025-03-05

v12.6.0 → v13.0.02026-04-03

PHP version history (4 changes)v1.1PHP ^8.2

v11.0.1PHP &gt;=8.2

v12.0PHP 8.2.\*|8.3.\*|8.4.\*

v13.0.0PHP 8.3.\*|8.4.\*|8.5.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd1bbe54b79d041b513a286058b6fa0c479343f82147da3e63eefdf29c2fa6cb?d=identicon)[codebar](/maintainers/codebar)

---

Top Contributors

[![RhysLees](https://avatars.githubusercontent.com/u/43909932?v=4)](https://github.com/RhysLees "RhysLees (25 commits)")

---

Tags

laravelpackagephpzendesklaravelZendeskcodebar-aglaravel-zendesk

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codebar-ag-laravel-zendesk/health.svg)

```
[![Health](https://phpackages.com/badges/codebar-ag-laravel-zendesk/health.svg)](https://phpackages.com/packages/codebar-ag-laravel-zendesk)
```

###  Alternatives

[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1123.7k](/packages/codebar-ag-laravel-docuware)[codebar-ag/laravel-zammad

Zammad integration with Laravel

107.1k](/packages/codebar-ag-laravel-zammad)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

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

PHPackages © 2026

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