effectra / laravel-support-ticket
The Effectra support ticket package for laravel.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/effectra/laravel-support-ticket
Requires
- effectra/laravel-status: ^1.0
Requires (Dev)
- pestphp/pest: ^2.28
- symfony/var-dumper: ^6.0
README
A simple and extensible support ticket management system for Laravel.
Built for teams that need to manage customer tickets and responses directly inside their Laravel apps.
π Features
- π« Manage support tickets with customizable status, topic, and importance level.
- π¬ Allow users and employees to exchange responses.
- π§© Fully configurable: define your own models, enums, and table names.
- βοΈ Includes ready-to-publish migrations and config file.
- π Supports multiple languages (English & Arabic out of the box).
- πͺΆ Built with Spatie Laravel Package Tools for clean integration.
π¦ Installation
composer require effectra/laravel-support-ticket
Requires PHP β₯ 8.1 and Laravel β₯ 10.
βοΈ Configuration
Publish the config and migrations:
php artisan vendor:publish --tag="support-ticket-config" php artisan vendor:publish --tag="support-ticket-migrations"
Or run the install command provided by Spatieβs package tools:
php artisan support-ticket:install
Then run your migrations:
php artisan migrate
π§° Configuration Options
The published config file is located at:
config/support-ticket.php
Example configuration
return [ 'tables' => [ 'tickets' => 'support_tickets', 'responses' => 'support_tickets_responses', 'users' => 'users', 'employees' => 'users', ], 'models' => [ 'user' => \App\Models\User::class, 'employee' => \App\Models\User::class, 'ticket_response' => Effectra\LaravelSupportTicket\Models\TicketResponse::class, ], 'default' => [ 'status' => \Effectra\LaravelSupportTicket\Enums\TicketStatusEnum::PENDING->value, 'importance_level' => \Effectra\LaravelSupportTicket\Enums\TicketImportanceLevelEnum::LOW->value, 'topic' => \Effectra\LaravelSupportTicket\Enums\TicketTopicEnum::GENERAL_INQUIRY->value, ], ];
π§± Migrations
The package includes two migrations:
- support_tickets β stores the main ticket data.
- support_tickets_responses β stores replies from users/employees.
You can modify these before running php artisan migrate.
π§© Enums
Enums are used for strong typing and cleaner logic:
| Enum | Values |
|---|---|
TicketStatusEnum |
PENDING, OPEN, CLOSED, RESOLVED |
TicketTopicEnum |
GENERAL_INQUIRY, TECHNICAL_ISSUE, BILLING, OTHER |
TicketImportanceLevelEnum |
LOW, MEDIUM, HIGH, CRITICAL |
Example usage:
use Effectra\LaravelSupportTicket\Enums\TicketStatusEnum; $ticket->status = TicketStatusEnum::OPEN->value;
π§ Basic Usage Example
Creating a Ticket
use Effectra\LaravelSupportTicket\Models\Ticket; use Effectra\LaravelSupportTicket\Enums\TicketStatusEnum; $ticket = Ticket::create([ 'title' => 'Unable to access account', 'body' => 'I am getting a 403 error when logging in.', 'status' => TicketStatusEnum::PENDING->value, 'user_id' => auth()->id(), ]);
Adding a Response
use Effectra\LaravelSupportTicket\Models\TicketResponse; TicketResponse::create([ 'ticket_id' => $ticket->id, 'message' => 'We are checking your issue.', 'responder_id' => auth()->id(), 'responder_type' => \App\Models\User::class, ]);
Getting Ticket Responses
$responses = $ticket->responses; // Collection of TicketResponse models
π Localization
Translations are stored in:
localization/en/
localization/ar/
You can publish and customize them:
php artisan vendor:publish --tag="support-ticket-translations"
π§© Service Provider
The package automatically registers itself via Laravelβs package discovery.
However, if you need to register manually, add to your config/app.php:
'providers' => [ Effectra\LaravelSupportTicket\Providers\LaravelSupportTicketServiceProvider::class, ],
π§ͺ Testing
To run the tests:
composer test
(Youβll need to create factories and test cases in your consuming app.)
π License
This package is open-sourced software licensed under the MIT license.
π¨βπ» Author
Mohammed Taha (BMT) Senior Full-Stack Developer β PHP / Laravel / React / TypeScript / NextJs π§ info@mohammedtaha.me π github.com/BMTmohammedtaha
β Contributing
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or submit an issue on GitHub.
π Quick Recap
composer require effectra/laravel-support-ticket php artisan support-ticket:install php artisan migrate
Then start managing your support tickets π