yeknava/simple-ticketing

laravel 的简单票务包

1.1 2021-04-18 11:46 UTC

This package is auto-updated.

Last update: 2024-09-18 19:07:22 UTC


README

Laravel Simple Ticketing Package 允许您在应用程序中处理简单的票务案例。所有内容都在配置文件中定义,您甚至可以决定是否需要在数据库中存储票务,或者只是通过管理员的电子邮件地址发送。

安装

使用包管理器 composer 安装简单票务包。

composer require yeknava/simple-ticketing

使用方法

在您的终端中运行此命令

php artisan vendor:publish

配置

<?php

return [
    /*
     * route's base path that will be used for package specific routes.
     * (use 'php artisan route:list' to find out all paths)
     */
    'route_base_path' => 'tickets',

    'categories' => [
        [
            'label' => 'bug report',
            'value' => 'bug'
        ],
        [
            'label' => 'feature request',
            'value' => 'feature'
        ],
    ],

    'priorities' => [
        [
            'label' => 'low',
            'value' => 1
        ],
        [
            'label' => 'normal',
            'value' => 2
        ],
        [
            'label' => 'high',
            'value' => 3
        ],
    ],

    /*
     * admin's email address that will be used to notify him/her for each user tickets
     */
    'admin_email' => env('ST_ADMIN_EMAIL', ''),

    /*
     * specify fields that user required to fill for sending ticket
     */
    'required_user_info' => [
        'email',
        //'phone',
        //'name'
    ],

    /*
     * middleware checks that admin needs to pass to respond to ticket or reply one
     */
    'admin_middlewares' => ['auth:admin'],

    /*
     * middleware checks that user needs to pass to send ticket or reply one
     */
    'user_middlewares' => [],

    /*
     * if true it would check category and priority fields to match with values
     * defined in above to ensure values are in correct range, otherwise
     * users may specify category or priority fields by themselves
     */
    'force_check_fields' => false,

    /*
     * set this true if you need store tickets to database,
     * otherwise it would just pass to admin email
     */
    'store_in_database' => true,

    /*
     * Notify user via email whenever admin respond or reply (yes they are different!
     * each ticket may have only one respond message from admin and/or unlimited
     * reply from admin or user) to a ticket,
     * (tickets should store to database and email column should be filled)
     */
    'respond_email_notify' => true,

    /*
     * reply option allows admin and users continue their communication on same topic.
     */
    'reply' => true,

    'list_paginate' => 15
];

贡献

欢迎提交拉取请求。对于重大更改,请首先创建一个问题来讨论您想进行哪些更改。

许可协议

MIT