roundly-consulting / tickets-for-laravel
Headless helpdesk ticketing core: categories, swappable statuses, replies and internal notes, assignment, priorities, due dates, custom fields, guest requesters and optional projects.
Package info
github.com/roundly-consulting/tickets-for-laravel
pkg:composer/roundly-consulting/tickets-for-laravel
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/auth: ^12.0|^13.0
- illuminate/cache: ^12.0|^13.0
- illuminate/console: ^12.0|^13.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/events: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/notifications: ^12.0|^13.0
- illuminate/routing: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- illuminate/validation: ^12.0|^13.0
- roundly-consulting/attributes-for-laravel: ^1.1.1
- roundly-consulting/comments-for-laravel: ^1.1.1
- roundly-consulting/enums-for-laravel: ^1.1.0
- roundly-consulting/lifecycle-for-laravel: ^1.0.2
- roundly-consulting/media-library-for-laravel: ^1.1.4
- roundly-consulting/package-toolkit-for-laravel: ^1.3.0
- roundly-consulting/query-builder-for-laravel: ^1.2.1
- roundly-consulting/sluggable-for-laravel: ^1.1.2
- roundly-consulting/translatable-for-laravel: ^1.1.2
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- nunomaduro/collision: ^8.5
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- roundly-consulting/testing-for-laravel: ^1.6.0
Suggests
- roundly-consulting/metrics-for-laravel: Ticket dashboards and trends.
- roundly-consulting/permissions-for-laravel: Agent roles that satisfy the tickets.* Gate abilities.
- roundly-consulting/teams-for-laravel: Assign tickets to teams (a Team implementing Contracts\Assignee).
Provides
None
Conflicts
None
Replaces
None
README
Tickets for Laravel
A headless helpdesk core for Laravel apps: categories, swappable statuses, public replies and internal notes, assignment, priorities, due dates, custom fields, guest requesters and optional projects — behind one facade, with an opt-in JSON API and mail notifications in English and Slovak.
Installation
Requires PHP 8.4, Laravel 12 or 13, and a MySQL or PostgreSQL database.
composer require roundly-consulting/tickets-for-laravel php artisan tickets:install php artisan migrate
tickets:install publishes the config and the migrations of tickets and the packages it builds on,
and prints the key types to settle first: with UUID or ULID user keys, set them before
migrating. Overdue flags and auto-close run on the scheduler:
// routes/console.php use Illuminate\Support\Facades\Schedule; Schedule::command('tickets:sweep')->everyFiveMinutes(); // overdue and due-soon flags Schedule::command('lifecycle:sweep')->everyMinute(); // closes resolved tickets after 7 days
Agents take tickets, so your user model implements the assignee contract:
class User extends Authenticatable implements Assignee { use IsTicketAssignee; }
(RoundlyConsulting\Tickets\Contracts\Assignee, RoundlyConsulting\Tickets\Concerns\IsTicketAssignee).
Usage
File, work and resolve a ticket through the facade ($customer and $agent are your users):
use Illuminate\Support\Facades\Gate; use RoundlyConsulting\Tickets\Facades\Tickets; // Who is an agent is your call: is_support stands for your own agent flag. An undefined ability denies. Gate::define('tickets.agent', fn ($user) => $user->is_support); // A category, once: its defaults apply to every ticket filed under it. $hardware = Tickets::categories()->make(['en' => 'Hardware', 'sk' => 'Hardvér']) ->defaults(priority: 'high', dueIn: 'P1D') ->create(); // The customer opens a ticket — numbered TCK-1, high priority, due in a day. $ticket = Tickets::make() ->subject('Printer on floor 3 is jammed') ->description('Paper jam error E-102 since this morning.') ->requester($customer) ->category($hardware) ->create(); // An agent takes it, answers the customer and leaves a note only agents see. Tickets::for($ticket)->by($agent)->claim()->start(); Tickets::for($ticket)->by($agent)->reply('A technician is on the way.', transition: 'wait'); Tickets::for($ticket)->by($agent)->note('Roller worn out, order a spare.'); // The customer's reply puts it back in the queue; the agent resolves it. Tickets::for($ticket)->by($customer)->reply('Works again, thanks!'); Tickets::for('TCK-1')->by($agent)->resolve('Roller replaced.'); Tickets::for('TCK-1')->status(); // TicketStatus::Resolved Tickets::for('TCK-1')->thread(); // the two public replies — never the note
Documentation
The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/tickets-for-laravel
Release notes are in CHANGELOG.md. To contribute, see the contributing guide.
Support our work
This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.
License
The MIT License (MIT). See LICENSE.md.