Download the PHP package ligoo/zammad-laravel without Composer
On this page you can find all versions of the php package ligoo/zammad-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zammad-laravel
Zammad Laravel
A Laravel package for integrating contact forms with the Zammad ticketing system.
Features
- Easy Integration: Drop-in contact form that creates tickets in Zammad
- Flexible CAPTCHA: Support for Google reCAPTCHA v3, Cloudflare Turnstile, or disabled
- 8-Layer Spam Protection: Rate limiting, honeypot, form timer, keyword detection, and more
- Multiple Frameworks: Blade, React, and Vue.js components included
- Customizable Views: Framework-agnostic styling with CSS variables
- Full Configuration: All options via config file with env variable support
Requirements
- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
- Zammad instance with API access
Installation
Configuration
Publish the configuration file:
Add the following to your .env file:
Getting a Zammad API Token
- Log into Zammad as admin
- Go to Admin → API → Personal Access Tokens
- Create a new token with permissions:
ticket.agent(to create/update tickets)admin(recommended for full API access)
Setting Up the API User
The user who owns the API token must have group access to create tickets:
- Go to Admin → Manage → Users
- Find the user who created the API token
- Edit the user and go to Group permissions
- Add your target group with full access
- Save
Important: Token permissions alone are not enough. The user must also have explicit group access in their user profile.
Finding Your Group ID
- Go to Admin → Manage → Groups
- Click on the group you want to use
- The ID is in the URL:
/manage/groups/38→ ID is38
Testing Your Configuration
After setup, verify everything works:
This command tests:
- API connectivity
- Token validity
- User permissions
- Group access
- Ticket creation
If any test fails, the output will explain what's wrong.
Usage
Blade (Default)
The package automatically registers routes at /contact. Visit /contact to see the form.
Include in your own layout:
Add the stylesheet to your layout's <head>:
Publish assets:
React
Publish the React component:
This copies ZammadContactForm.tsx to resources/js/vendor/zammad/react/.
Step 1: Disable the package's GET route (so you can use your own Inertia page):
Step 2: Create your Inertia route and controller:
Step 3: Ensure your layout has the CSRF meta tag (required for form submission):
Note: Inertia.js apps typically include this by default. Check your
app.blade.php.
Use in your React component:
React Props
| Prop | Type | Required | Description |
|---|---|---|---|
config |
ContactFormConfig |
Yes | Form configuration from ContactController::getFormConfig() |
submitUrl |
string |
No | Submit URL (default: /contact) |
url |
string |
No | Optional URL to attach to the ticket |
onSuccess |
function |
No | Callback on successful submission |
onError |
function |
No | Callback on validation errors |
className |
string |
No | Additional CSS classes |
Vue.js
Publish the Vue component:
This copies ZammadContactForm.vue to resources/js/vendor/zammad/vue/.
Follow the same setup as React (disable GET route, create your Inertia route).
Use in your Vue component:
Vue Props
| Prop | Type | Required | Description |
|---|---|---|---|
config |
ContactFormConfig |
Yes | Form configuration from ContactController::getFormConfig() |
submitUrl |
string |
No | Submit URL (default: /contact) |
url |
string |
No | Optional URL to attach to the ticket |
className |
string |
No | Additional CSS classes |
Vue Events
| Event | Payload | Description |
|---|---|---|
success |
{ message } |
Emitted on successful submission |
error |
{ [field]: string[] } |
Emitted on validation errors |
Route Configuration
Routes use generic names to keep your backend technology hidden:
- URL:
/contact - Route names:
support.contact.form,support.contact.submit
Customize in your .env:
Inertia / SPA Setup
For Inertia, React, or Vue.js apps, disable only the GET route so you can define your own page while keeping the package's POST handler:
Then in your routes file:
Manual Route Registration
To fully control all routes, disable auto-routes:
Register manually:
Configuration Options
CAPTCHA Drivers
| Driver | Description |
|---|---|
none |
Disabled (default) |
recaptcha_v3 |
Google reCAPTCHA v3 (invisible, score-based) |
turnstile |
Cloudflare Turnstile (privacy-focused) |
Spam Protection
The package includes 8 layers of spam protection:
- Rate Limiting (Middleware) - 5 attempts per 60 seconds
- Rate Limiting (Cache) - 2 minute cooldown after submission
- CAPTCHA - Configurable provider
- Honeypot Field - Hidden field that must remain empty
- Form Timer - Minimum 3 seconds before submission
- Spam Keywords - Blocks messages with blacklisted words
- URL Count - Blocks messages with too many URLs
- Confirmation Checkbox - User must confirm
Customizing Subject Options
Edit config/zammad.php:
CSS Customization
The CSS uses CSS variables for easy theming. Override in your own stylesheet:
Available variables:
| Variable | Default | Description |
|---|---|---|
--zammad-primary |
#2563eb |
Primary button/accent color |
--zammad-primary-hover |
#1d4ed8 |
Hover state |
--zammad-error |
#dc2626 |
Error messages |
--zammad-success |
#16a34a |
Success messages |
--zammad-text |
#1f2937 |
Text color |
--zammad-border |
#e5e7eb |
Border color |
--zammad-radius |
0.375rem |
Border radius |
Localization
The package includes translations for 13 languages:
| Code | Language |
|---|---|
en |
English |
fr |
French |
de |
German |
it |
Italian |
es |
Spanish |
pt |
Portuguese |
nl |
Dutch |
no |
Norwegian |
sv |
Swedish |
da |
Danish |
fi |
Finnish |
hu |
Hungarian |
pl |
Polish |
The package automatically uses Laravel's current locale (app()->getLocale()).
Customizing Translations
Publish the translation files to customize:
This copies files to lang/vendor/zammad/. Edit the files in your preferred language.
Adding New Languages
Create a new file at lang/vendor/zammad/{locale}/zammad.php following the structure of the English file.
Publishing Assets
Facades
Zammad Facade
Captcha Facade
Troubleshooting
403 Forbidden when creating tickets
Symptom: php artisan zammad:test passes connectivity tests but fails on ticket creation with 403.
Cause: The API user doesn't have access to the configured group.
Fix:
- Run
php artisan zammad:testto see which groups the user has access to - Go to Admin → Manage → Users in Zammad
- Edit the API user and add the target group with full access
422 Unprocessable Entity
Symptom: Ticket creation fails with 422 error.
Cause: Invalid data being sent (wrong group ID, invalid customer, etc.)
Fix:
- Verify
ZAMMAD_DEFAULT_GROUPis a valid group ID - Run
php artisan zammad:testto see available groups
419 Page Expired (CSRF token mismatch)
Symptom: React/Vue form submission fails with 419 error.
Cause: Missing CSRF meta tag in your layout.
Fix: Add to your layout's <head>:
Translations showing as keys
Symptom: Form shows zammad::zammad.contact.title instead of actual text.
Cause: Translation files not loaded or published incorrectly.
Fix:
Testing
Disclaimer
This package is an independent, community-developed project. It is NOT affiliated with, endorsed by, or officially connected to Zammad GmbH, Laravel LLC, Google LLC, Cloudflare Inc., or any of their products.
No Warranty: The authors are not liable for any loss of messages, data, communications, security vulnerabilities, or any other issues that may occur through the use of this software. Users are responsible for:
- Verifying ticket creation and message delivery
- Conducting their own security audits
- Implementing appropriate backup and security measures
See LICENSE for full terms.
License
MIT License. See LICENSE for details.
All versions of zammad-laravel with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0