https://github.com/effectra/laravel-support-ticket
The Effectra support ticket package for laravel.
https://github.com/effectra/laravel-support-ticket
Last synced: 4 months ago
JSON representation
The Effectra support ticket package for laravel.
- Host: GitHub
- URL: https://github.com/effectra/laravel-support-ticket
- Owner: effectra
- License: mit
- Created: 2025-08-29T19:26:54.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-08-29T19:33:10.000Z (9 months ago)
- Last Synced: 2025-08-29T21:27:44.187Z (9 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Support Ticket
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](https://github.com/spatie/laravel-package-tools) for clean integration.
---
## π¦ Installation
```bash
composer require effectra/laravel-support-ticket
````
> Requires **PHP β₯ 8.1** and **Laravel β₯ 10**.
---
## βοΈ Configuration
Publish the config and migrations:
```bash
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:
```bash
php artisan support-ticket:install
```
Then run your migrations:
```bash
php artisan migrate
```
---
## π§° Configuration Options
The published config file is located at:
```
config/support-ticket.php
```
### Example configuration
```php
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:
1. **support_tickets** β stores the main ticket data.
2. **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:
```php
use Effectra\LaravelSupportTicket\Enums\TicketStatusEnum;
$ticket->status = TicketStatusEnum::OPEN->value;
```
---
## π§ Basic Usage Example
### Creating a Ticket
```php
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
```php
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
```php
$responses = $ticket->responses; // Collection of TicketResponse models
```
---
## π Localization
Translations are stored in:
```
localization/en/
localization/ar/
```
You can publish and customize them:
```bash
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`:
```php
'providers' => [
Effectra\LaravelSupportTicket\Providers\LaravelSupportTicketServiceProvider::class,
],
```
---
## π§ͺ Testing
To run the tests:
```bash
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](LICENSE).
---
## π¨βπ» Author
**Mohammed Taha (BMT)**
Senior Full-Stack Developer β PHP / Laravel / React / TypeScript / NextJs
π§ [info@mohammedtaha.me](mailto:info@mohammedtaha.me)
π [github.com/BMTmohammedtaha](https://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
```bash
composer require effectra/laravel-support-ticket
php artisan support-ticket:install
php artisan migrate
```
Then start managing your support tickets π