{"id":14975333,"url":"https://github.com/muhammadn/laravel-zammad","last_synced_at":"2025-10-27T13:30:29.367Z","repository":{"id":57021795,"uuid":"137587848","full_name":"muhammadn/laravel-zammad","owner":"muhammadn","description":"Laravel wrapper around the official Zammad PHP API Library","archived":false,"fork":false,"pushed_at":"2018-06-22T01:58:09.000Z","size":68,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T05:41:18.485Z","etag":null,"topics":["api","laravel","laravel-framework","php","wrapper","wrapper-library","zammad"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammadn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-16T14:49:29.000Z","updated_at":"2023-10-17T08:58:29.000Z","dependencies_parsed_at":"2022-08-23T12:20:41.022Z","dependency_job_id":null,"html_url":"https://github.com/muhammadn/laravel-zammad","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadn%2Flaravel-zammad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadn%2Flaravel-zammad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadn%2Flaravel-zammad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadn%2Flaravel-zammad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadn","download_url":"https://codeload.github.com/muhammadn/laravel-zammad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238497658,"owners_count":19482295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","laravel","laravel-framework","php","wrapper","wrapper-library","zammad"],"created_at":"2024-09-24T13:51:53.065Z","updated_at":"2025-10-27T13:30:29.037Z","avatar_url":"https://github.com/muhammadn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-zammad\nLaravel wrapper around the official Zammad PHP API Library\n\nThis wrapper depends on the official [Zammad PHP Client](https://github.com/zammad/zammad-api-client-php)\n\n## Installation\n\n### Requirements\nThe API client needs [composer](https://getcomposer.org/). For installation have a look at its [documentation](https://getcomposer.org/download/).\nAdditionally, the API client needs PHP 5.6 or newer.\n\n### Integration into your project\nRun the following command within the root folder of your laravel project to install the wrapper:\n```\ncomposer require muhammadn/laravel-zammad\n```\n\n### Add Zammad credentials for your Laravel installation\nEdit your .env file (at the root folder of your laravel project) and add your username, password and url of your zammad installation\n```\nZAMMAD_USERNAME='your_zammad_email'\nZAMMAD_PASSWORD='zammad_password'\nZAMMAD_URL='https://your-zammad-instance'\n### Optional parameters\n# Sets on behalf if you want to use API **as another user**\n# which is different than your ZAMMAD_USERNAME above\nZAMMAD_ON_BEHALF_USER='otheruser@user.com'\n# Sets the debug mode\nZAMMAD_DEBUG=true\n# Sets the API client timeout to Zammad API\nZAMMAD_TIMEOUT=15\n```\n\n### Configure your laravel providers to use this wrapper\nEdit config/app.php and add in providers section:\n```php\n    'providers' =\u003e [\n        .... all the other providers ....\n        Muhammadn\\LaravelZammad\\ZammadServiceProvider::class,\n    ],\n```      \n\n### Configure your laravel Facade to use this wrapper\nEdit config/app.php and add in aliases section:\n```php\n    'aliases' =\u003e [\n        ... all the other facades ...\n        'LaravelZammad' =\u003e Muhammadn\\LaravelZammad\\ZammadFacade::class,\n    ]\n```\n## How to use this wrapper\n\nExample code:\n```php\nuse LaravelZammad;\n\nclass MyController extends Controller\n{\n\n  public function index(LaravelZammad $zammad)\n  {\n      // get all tickets\n      $data = $zammad::all('ticket');\n      // get all tickets with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::all('ticket', 4, 50);\n\n      // get ticket of specific id\n      $data = $zammad::find('ticket', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value \n      $data-\u003egetValue('title');\n\n      // get articles from ticket\n      $ticket = $zammad::find('ticket', 34);\n      $articles = $ticket-\u003egetTicketArticles();\n      // get first article content\n      $article_content = $articles[0]-\u003egetValues();\n\n      // Search the data\n      $data = $zammad::search('ticket', 'text that you want to search')\n      // get search results with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::search('ticket', 'text you want to search', 4, 50);\n\n      // Add new ticket\n      $ticket_values = ['title' =\u003e 'Test Ticket', 'owner_id' =\u003e 1]\n      $data = $zammad::create('ticket', $ticket_values)\n\n      // Update a ticket\n      $ticket_values = ['title' =\u003e 'Test Ticket', 'owner_id' =\u003e 1]\n      $data = $zammad::update('ticket', $ticket_id, $ticket_values)\n\n      // Delete a ticket\n      $data = $zammad::delete('ticket', $ticket_id)\n    }\n}\n```\n\nExample code for users:\n```php\nuse LaravelZammad;\n\nclass MyController extends Controller\n{\n\n  public function index(LaravelZammad $zammad)\n  {\n      // get all users\n      $data = $zammad::all('user');\n      // get all users with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::all('user', 4, 50);\n\n      // get user of specific id\n      $data = $zammad::find('user', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value\n      $data-\u003egetValue('title');\n\n      // Search the data\n      $data = $zammad::search('user', 'text that you want to search')\n      // get search results with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::search('user', 'text you want to search', 4, 50);\n\n      // Add new User\n      $user_values = ['email' =\u003e 'user@user.com', 'owner_id' =\u003e 1]\n      $data = $zammad::create('user', $user_values)\n\n      // Update a user\n      $user_values = ['email' =\u003e 'user@user.com', 'owner_id' =\u003e 1]\n      $data = $zammad::update('user', $user_id, $user_values)\n\n      // Delete a user\n      $data = $zammad::delete('user', $user_id)\n    }\n}\n```\n\nExample code for groups:\n```php\nuse LaravelZammad;\n\nclass MyController extends Controller\n{\n\n  public function index(LaravelZammad $zammad)\n  {\n      // get all groups\n      $data = $zammad::all('group');\n      // get all groups with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::all('group', 4, 50);\n\n      // get group of specific id\n      $data = $zammad::find('group', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value\n      $data-\u003egetValue('title');\n\n      // Add new Group\n      $group_values = ['name' =\u003e 'ZammadGroup']\n      $data = $zammad::create('group', $group_values)\n\n      // Update a group\n      $group_values = ['name' =\u003e 'ZammadGroup2']\n      $data = $zammad::update('group', $group_id, $group_values)\n\n      // Delete a group\n      $data = $zammad::delete('group', $group_id)\n    }\n}\n```\n\nExample code for ticket state:\n```php\nuse LaravelZammad;\n\nclass MyController extends Controller\n{\n\n  public function index(LaravelZammad $zammad)\n  {\n      // get all ticket states\n      $data = $zammad::all('ticket_state');\n      // get all ticket states with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::all('ticket_state', 4, 50);\n\n      // get ticket state of specific id\n      $data = $zammad::find('ticket_state', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value\n      $data-\u003egetValue('title');\n\n      // Add new ticket state\n      $state_values = ['name' =\u003e 'delayed', 'active' =\u003e true]\n      $data = $zammad::create('ticket_state', $state_values)\n\n      // Update a ticket state\n      $state_values = ['name' =\u003e 'boarding', 'active' =\u003e true]\n      $data = $zammad::update('ticket_state;, $state_id, $state_values)\n\n      // Delete a ticket state\n      $data = $zammad::delete('ticket_state', $state_id)\n    }\n}\n```\n\nExample code for ticket priority:\n```php\nuse LaravelZammad;\n\nclass MyController extends Controller\n{\n\n  public function index(LaravelZammad $zammad)\n  {\n      // get all ticket priorities\n      $data = $zammad::all('ticket_priority');\n      // get all ticket states with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::all('ticket_prioriry', 4, 50);\n\n      // get ticket priority of specific id\n      $data = $zammad::find('ticket_priority', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value\n      $data-\u003egetValue('title');\n\n      // Add new ticket priority\n      $priority_values = ['name' =\u003e '4 urgent', 'active' =\u003e true]\n      $data = $zammad::create('ticket_priority', $priority_values)\n\n      // Update a ticket priority\n      $priority_values = ['name' =\u003e '5 very very urgent', 'active' =\u003e true]\n      $data = $zammad::update('ticket_priority', $priority_id, $priority_values)\n\n      // Delete a ticket state\n      $data = $zammad::delete('ticket_priority', $priority_id)\n    }\n}\n```\n\nExample code for ticket articles:\n```php\n  public function index(LaravelZammad $zammad)\n  {\n      // get ticket article of specific id\n      $data = $zammad::find('ticket_article', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value\n      $data-\u003egetValue('title');\n\n      // Add ticket article\n      $ticket_article_values = ['ticket_id' =\u003e 1, 'type_id' =\u003e 5, 'sender_id' =\u003e 2]\n      $data = $zammad::create('ticket_article', $ticket_article_values)\n\n      // Update a ticket article\n      $ticket_article_values = ['ticket_id' =\u003e 2, 'type_id' =\u003e 3, 'sender_id' =\u003e 7]\n      $data = $zammad::update('ticket_article', $ticket_article_id, $ticket_article_values)\n\n      // Delete a ticket article\n      $data = $zammad::delete('ticket_article', $ticket_article_id)\n\n```\n\nExample code for Organizations:\n```php\nuse LaravelZammad;\n\nclass MyController extends Controller\n{\n\n  public function index(LaravelZammad $zammad)\n  {\n      // get all organizations\n      $data = $zammad::all('organization');\n      // get all organizations with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::all('organization', 4, 50);\n\n      // get organization of specific id\n      $data = $zammad::find('organization', 34);\n\n      // To view the data (all values)\n      $data-\u003egetValues();\n\n      // Get single value\n      $data-\u003egetValue('title');\n\n      // Search the data\n      $data = $zammad::search('organization', 'text that you want to search')\n      // get search results with pagination\n      // example below for page 4, 50 entries at a time.\n      $data = $zammad::search('organization', 'text you want to search', 4, 50);\n\n      // Add organization\n      $organization_values = ['name' =\u003e 'Zammad', 'active' =\u003e true]\n      $data = $zammad::create('organization', $organization_values)\n\n      // Update an organization\n      $organization_values = ['name' =\u003e 'Zammad', 'active' =\u003e true]\n      $data = $zammad::update('organization', $organization_id, $organization_values)\n\n      // Delete an organization\n      $data = $zammad::delete('organization', $organization_id)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadn%2Flaravel-zammad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadn%2Flaravel-zammad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadn%2Flaravel-zammad/lists"}