A comprehensive ticket system for Laravel applications with multi-language support
cavitznky/ticket-system is a Laravel package for a comprehensive ticket system for laravel applications with multi-language support.
It currently has 0 GitHub stars and 14 downloads on Packagist (latest version v1.1.2).
Install it with composer require cavitznky/ticket-system.
Discover more Laravel packages by cavitznky
or browse all Laravel packages to compare alternatives.
Last updated
A comprehensive ticket system for Laravel applications.
You can install the package via composer:
composer require cavitznky/ticket-system
You can publish the config, migrations, views, and translations using the following commands:
# Publish migrations
php artisan vendor:publish --tag="ticket-system-migrations"
# Publish config
php artisan vendor:publish --tag="ticket-system-config"
# Publish views
php artisan vendor:publish --tag="ticket-system-views"
# Publish translations
php artisan vendor:publish --tag="ticket-system-translations"
# Publish Livewire component
php artisan vendor:publish --tag="ticket-system-components"
# Publish models
php artisan vendor:publish --tag="ticket-system-models"
# Publish traits
php artisan vendor:publish --tag="ticket-system-traits"
# Publish all components (Livewire, Models, Traits)
php artisan vendor:publish --tag="ticket-system-all-components"
# Or publish everything
php artisan vendor:publish --provider="Digitalcake\TicketSystem\TicketSystemServiceProvider"
You can publish and modify all the components to adapt them to your needs:
# For example, to customize the Livewire component
php artisan vendor:publish --tag="ticket-system-components"
After publishing, the components will be available in your application:
app/Livewire/TicketSystem.phpapp/Models/TicketSystem/app/Traits/TicketSystem/Modify them according to your needs. When you publish a component, you take full control of it and it will no longer be updated when you update the package.
If you've published the Livewire component, make sure to update your view to use your application's namespace:
<livewire:ticket-system /> <!-- Uses the package component -->
<!-- After publishing the Livewire component: -->
<livewire:ticket-system /> <!-- Now uses your customized component in App\Livewire -->
Note: Laravel will automatically use the component from your application instead of the one from the package.
To make your User model compatible with the ticket system, use the HasTickets trait:
use Digitalcake\TicketSystem\Traits\HasTickets;
class User extends Authenticatable
{
use HasTickets;
// ...
}
To define admin users who can manage all tickets, add the getTicketAdmin method to your User model:
public function getTicketAdmin(): bool
{
// Define your logic to determine if a user is an admin
return $this->isAdmin(); // or any other logic
}
Add the ticket system component to your view:
<livewire:ticket-system />
The package supports the following languages:
You can customize the ticket system by publishing the config file:
return [
// Number of tickets per page
'per_page' => 10,
// Other configuration options...
];
This package provides the following events that you can listen to in your application:
Fired when a new ticket is created.
use Digitalcake\TicketSystem\Events\TicketCreated;
// In your EventServiceProvider
protected $listen = [
TicketCreated::class => [
// Your listeners here
],
];
// In your listener
public function handle(TicketCreated $event)
{
$ticket = $event->ticket;
// Do something with the ticket
}
Fired when a ticket is updated.
use Digitalcake\TicketSystem\Events\TicketUpdated;
// In your EventServiceProvider
protected $listen = [
TicketUpdated::class => [
// Your listeners here
],
];
// In your listener
public function handle(TicketUpdated $event)
{
$ticket = $event->ticket;
$originalData = $event->originalData;
// Do something with the ticket and original data
}
Fired when a ticket's status is changed.
use Digitalcake\TicketSystem\Events\TicketStatusChanged;
// In your EventServiceProvider
protected $listen = [
TicketStatusChanged::class => [
// Your listeners here
],
];
// In your listener
public function handle(TicketStatusChanged $event)
{
$ticket = $event->ticket;
$oldStatus = $event->oldStatus;
$newStatus = $event->newStatus;
// Do something with the ticket and status information
}
Fired when a response is added to a ticket.
use Digitalcake\TicketSystem\Events\TicketResponseAdded;
// In your EventServiceProvider
protected $listen = [
TicketResponseAdded::class => [
// Your listeners here
],
];
// In your listener
public function handle(TicketResponseAdded $event)
{
$ticket = $event->ticket;
$response = $event->response;
// Do something with the ticket and response
}
Fired when a ticket is deleted.
use Digitalcake\TicketSystem\Events\TicketDeleted;
// In your EventServiceProvider
protected $listen = [
TicketDeleted::class => [
// Your listeners here
],
];
// In your listener
public function handle(TicketDeleted $event)
{
$ticketId = $event->ticketId;
$ticketData = $event->ticketData;
// Do something with the ticket ID and data
}
The MIT License (MIT). Please see License File for more information.