PHP code example of ccbox / admin-workorder

1. Go to this page and download the library: Download ccbox/admin-workorder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ccbox / admin-workorder example snippets


    'extensions' => [

        'admin-workorder' => [
            // 如果要关掉这个扩展,设置为false
            'enable' => true,
            // 设置本地启用的文本编辑器(工单内容字段)
            'editor' => [
                // 编辑器扩展名
                // 设置为 text/textarea 则使用单行/多行文本框,不使用富文本编辑器
                'name' => 'editor',
                // 编辑器自定义参数
                // 请先确认启用的编辑器是否支持options配置再填写,为空时则使用编辑器的默认配置
                'config' => [],
            ],
            // 工单附件存储盘
            // 留空或不填则使用admin.upload.disk中的配置
            'files_disk' => '',
        ],

    ]

// 获取用户工单列表
AdminWorkorder::getTickets($user);

// 获取某工单详情
AdminWorkorder::getTicketInfo($id);

/**
 * 添加工单
 * @param string $content
 * @param array $images
 * @param User $user
 * @param int $p_id
 */
AdminWorkorder::addTicket($content, $up_images, $user, $p_id);//添加工单
bash
# 运行安装(暂不支持)
# php artisan admin-workorder:install
# 运行升级(暂不支持)
# php artisan admin-workorder:update

# 请直接导入数据表
php artisan migrate --path=vendor/ccbox/admin-workorder/database/migrations