定制 cavitznky/ticket-system 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cavitznky/ticket-system

Composer 安装命令:

composer require cavitznky/ticket-system

包简介

A comprehensive ticket system for Laravel applications with multi-language support

README 文档

README

A comprehensive ticket system for Laravel applications.

Installation

You can install the package via composer:

composer require cavitznky/ticket-system

Publishing Assets

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"

Customization

Customizing the components

You can publish and modify all the components to adapt them to your needs:

  1. Publish the components you want to customize:
# For example, to customize the Livewire component
php artisan vendor:publish --tag="ticket-system-components"
  1. After publishing, the components will be available in your application:

    • Livewire component: app/Livewire/TicketSystem.php
    • Models: app/Models/TicketSystem/
    • Traits: app/Traits/TicketSystem/
  2. 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.

Using published components

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.

Usage

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
}

Adding the Livewire Component

Add the ticket system component to your view:

<livewire:ticket-system />

Features

  • Create, view, edit and delete tickets
  • Respond to tickets
  • Change ticket status (open, in progress, resolved, closed)
  • Set ticket priority (low, medium, high, urgent)
  • Filter tickets by status and priority
  • Search tickets by title and description
  • Multi-language support (EN, FR, NL, TR)

Languages

The package supports the following languages:

  • English (en)
  • French (fr)
  • Dutch (nl)
  • Turkish (tr)

Configuration

You can customize the ticket system by publishing the config file:

return [
    // Number of tickets per page
    'per_page' => 10,
    
    // Other configuration options...
];

Events

This package provides the following events that you can listen to in your application:

TicketCreated

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
}

TicketUpdated

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
}

TicketStatusChanged

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
}

TicketResponseAdded

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
}

TicketDeleted

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
}

License

The MIT License (MIT). Please see License File for more information.

cavitznky/ticket-system 适用场景与选型建议

cavitznky/ticket-system 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「support」 「laravel」 「helpdesk」 「livewire」 「ticket-system」 「cavitznky」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 cavitznky/ticket-system 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 cavitznky/ticket-system 我们能提供哪些服务?
定制开发 / 二次开发

基于 cavitznky/ticket-system 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 12
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-23