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

v1.1.0 2025-10-23 10:29 UTC

This package is auto-updated.

Last update: 2025-10-23 12:02:45 UTC


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:

  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:

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 πŸš€