PHPackages                             lumina/tickets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lumina/tickets

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

lumina/tickets
==============

Laravel Ticket System, to help you manage your tickets eaisly

v1.6.5(2y ago)021MITPHPPHP ^8.2

Since Mar 30Pushed 2y agoCompare

[ Source](https://github.com/CreateLumina/tickets)[ Packagist](https://packagist.org/packages/lumina/tickets)[ Docs](https://github.com/CreateLumina/tickets)[ Fund](https://www.buymeacoffee.com/ousid)[ Fund](https://ko-fi.com/ousid)[ RSS](/packages/lumina-tickets/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (6)Used By (0)

⚠️ All credits go to Coderflex ⚠️
---------------------------------

[](#️-all-credits-go-to-coderflex-️)

This is a custom version for Lumina products. All credits goes to [coderflexx/laravel-ticket](https://github.com/coderflexx/laravel-ticket)

 [![Laravisit Logo](art/logo.png)](art/logo.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a3ae3501d10b63bad2dc7256125d6c197717fcc78f4540f91c0eff26d9552078/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756d696e612f7469636b6574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lumina/tickets)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6c8b7b60a264e4af7e84bc0fe7f7a08d8b19eee7731237bc90cac110111d3a41/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f646572666c6578782f6c61726176656c2d7469636b65742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d74657374)](https://github.com/coderflexx/laravel-ticket/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ebc062dce69196a72dedbc67920a46181f8b0c6cbf30bae1ee37593d29e940e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f646572666c6578782f6c61726176656c2d7469636b65742f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65)](https://github.com/coderflexx/laravel-ticket/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/da15d75f7a21981ca658e647ab0b6b180c1c5b93f87f515064079c01a83e8de4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756d696e612f7469636b6574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lumina/tickets)

- [⚠️ All credits go to Coderflex ⚠️](#%EF%B8%8F-all-credits-go-to-coderflex-%EF%B8%8F)
- [Introduction](#introduction)
- [Installation](#installation)
- [Configuration](#configuration)
- [Preparing your model](#preparing-your-model)
- [Usage](#usage)
    - [Ticket Table Structure](#ticket-table-structure)
    - [Message Table Structure](#message-table-structure)
    - [Category Table Structure](#category-table-structure)
- [API Methods](#api-methods)
    - [Ticket API Methods](#ticket-api-methods)
    - [Ticket Relationship API Methods](#ticket-relationship-api-methods)
    - [Ticket Scopes](#ticket-scopes)
- [Handling File Upload](#handling-file-upload)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Credits](#credits)
- [License](#license)

Introduction
------------

[](#introduction)

**Laravel Ticket** package, is a Backend API to handle your ticket system, with an easy way.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require lumina/tickets
```

Configuration
-------------

[](#configuration)

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="ticket-migrations"
```

Before Running the migration, you may publish the config file, and make sure the current tables does not make a conflict with your existing application, and once you are happy with the migration table, you can run

```
php artisan migrate
```

Preparing your model
--------------------

[](#preparing-your-model)

Add `HasTickets` trait into your `User` model, along with `CanUseTickets` interface

```
...
use Lumina\Tickets\Concerns\HasTickets;
use Lumina\Tickets\Contracts\CanUseTickets;
...
class User extends Model implements CanUseTickets
{
    ...
    use HasTickets;
    ...
}
```

Usage
-----

[](#usage)

The Basic Usage of this package, is to create a `ticket`, then associate the `categories` to it.

You can associate as many as `categories` into a single ticket.

Here is an example

```
use Lumina\Tickets\Models\Ticket;
use Lumina\Tickets\Models\Category;

...
public function store(Request $request)
{
    /** @var User */
    $user = Auth::user();

    $ticket = $user->tickets()
                    ->create($request->validated());

    $category = Category::first();
    $ticket->attachCategories($category);

    // or you can create the categories & the tickets directly by:
    // $ticket->categories()->create(...);

    return redirect(route('tickets.show', $ticket->uuid))
            ->with('success', __('Your Ticket Was created successfully.'));
}

public function createCategory()
{
    // If you create a category/categories seperated from the ticket and wants to
    // associate it to a ticket, you may do the following.
    $category = Category::create(...);

    $category->tickets()->attach($ticket);

    // or maybe
    $category->tickets()->detach($ticket);
}
...
```

### Ticket Table Structure

[](#ticket-table-structure)

Column NameTypeDefaultID`integer``NOT NULL`UUID`string``NOT NULL`user\_id`integer``NOT NULL`title`string``NOT NULL`message`string``NOT NULL`status`string``open`created\_at`timestamp``NULL`updated\_at`timestamp``NULL`### Message Table Structure

[](#message-table-structure)

Column NameTypeDefaultID`integer``NOT NULL`user\_id`integer``NOT NULL`ticket\_id`integer``NOT NULL`message`string``NOT NULL`created\_at`timestamp``NULL`updated\_at`timestamp``NULL`### Category Table Structure

[](#category-table-structure)

Column NameTypeDefaultID`integer``NOT NULL`name`string``NULL`created\_at`timestamp``NULL`updated\_at`timestamp``NULL`API Methods
-----------

[](#api-methods)

### Ticket API Methods

[](#ticket-api-methods)

The `ticket` model came with handy methods to use, to make your building process easy and fast, and here is the list of the available **API**:

MethodArgumentsDescriptionExample`close``void`close the ticket`$ticket->close()``open``void`open a closed ticket`$ticket->open()``isOpen``void`check if the ticket open`$ticket->isOpen()``isClosed``void`check if the ticket closed`$ticket->isClosed()`### Ticket Relationship API Methods

[](#ticket-relationship-api-methods)

The `ticket` model has also a list of methods for interacting with another related models

MethodArgumentsDescriptionExample`attachCategories``mixed` ID, `array` attributes, `bool` touchassociate categories into an existing ticket`$ticket->attachCategories([1,2,3,4])``syncCategories``Model/array` IDs, `bool` detouchingassociate categories into an existing ticket`$ticket->syncCategories([1,2,3,4])``message``string` messageadd new message on an existing ticket`$ticket->message('A message in a ticket')`> The `attachCategories` and `syncCategories` methods, is an alternative for `attach` and `sync` laravel methods, and if you want to learn more, please take a look at this [link](https://laravel.com/docs/9.x/eloquent-relationships#attaching-detaching)

The `commentAsUser` accepts a user as a first argument, if it's null, the **authenticated** user will be user as default.

### Ticket Scopes

[](#ticket-scopes)

The `ticket` model has also a list of scopes to begin filter with.

MethodArgumentsDescriptionExample`opened``void`get the opened tickets`Ticket::opened()->get()``closed``void`get the closed tickets`Ticket::closed()->get()`Handling File Upload
--------------------

[](#handling-file-upload)

This package doesn't come with file upload feature (yet) Instead you can use [laravel-medialibrary](https://github.com/spatie/laravel-medialibrary) by **Spatie**, to handle file functionality.

The steps are pretty straight forward, all what you need to do is the following.

Extends the `Ticket` model, by creating a new model file in your application by

```
php artisan make:model Ticket

```

Then extend the base `Ticket Model`, then use `InteractWithMedia` trait by spatie package, and the interface `HasMedia`:

```
namespace App\Models\Ticket;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;

class Ticket extends \Lumina\Tickets\Models\Ticket implements HasMedia
{
    use InteractsWithMedia;
}
```

The rest of the implementation, head to [the docs](https://spatie.be/docs/laravel-medialibrary/v10/introduction) of spatie package to know more.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [ousid](https://github.com/ousid)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

5

Last Release

739d ago

PHP version history (2 changes)v1.6.1PHP ^8.1|^8.2

v1.6.2PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fcb24d27acf4653b9a40aeb2195235ca90f2a15f2690e704ae83dc3616fcfd6?d=identicon)[PadowYT2](/maintainers/PadowYT2)

---

Top Contributors

[![ousid](https://avatars.githubusercontent.com/u/21012933?v=4)](https://github.com/ousid "ousid (83 commits)")[![PadowYT2](https://avatars.githubusercontent.com/u/71085027?v=4)](https://github.com/PadowYT2 "PadowYT2 (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")[![neazk](https://avatars.githubusercontent.com/u/28840712?v=4)](https://github.com/neazk "neazk (5 commits)")[![krekas](https://avatars.githubusercontent.com/u/11015977?v=4)](https://github.com/krekas "krekas (4 commits)")[![JaberWiki](https://avatars.githubusercontent.com/u/55241455?v=4)](https://github.com/JaberWiki "JaberWiki (1 commits)")[![DannyCooper](https://avatars.githubusercontent.com/u/152804?v=4)](https://github.com/DannyCooper "DannyCooper (1 commits)")[![ennikin-skywalker](https://avatars.githubusercontent.com/u/9866493?v=4)](https://github.com/ennikin-skywalker "ennikin-skywalker (1 commits)")[![akiyamaSM](https://avatars.githubusercontent.com/u/12276076?v=4)](https://github.com/akiyamaSM "akiyamaSM (1 commits)")[![juliangarcess](https://avatars.githubusercontent.com/u/41131304?v=4)](https://github.com/juliangarcess "juliangarcess (1 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lumina-tickets/health.svg)

```
[![Health](https://phpackages.com/badges/lumina-tickets/health.svg)](https://phpackages.com/packages/lumina-tickets)
```

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[tonysm/globalid-laravel

Identify app models with a URI. Inspired by the globalid gem.

45101.6k2](/packages/tonysm-globalid-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
