PHPackages                             simialbi/yii2-ticket - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. simialbi/yii2-ticket

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

simialbi/yii2-ticket
====================

Ticketing system for yii2

2.0.0(3y ago)378632MITPHPPHP &gt;=5.6CI failing

Since Dec 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/simialbi/yii2-ticket)[ Packagist](https://packagist.org/packages/simialbi/yii2-ticket)[ RSS](/packages/simialbi-yii2-ticket/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (14)Versions (43)Used By (2)

Ticket system for yii2
======================

[](#ticket-system-for-yii2)

Resources
---------

[](#resources)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require --prefer-dist simialbi/yii2-ticket

```

or add

```
"simialbi/yii2-ticket": "^1.0.0"

```

to the `require` section of your `composer.json`.

Usage
-----

[](#usage)

In order to use this module, you will need to:

1. [Setup Module](#setup-module) your application so that the module is available.
2. [Create a user identity](#create-identity) class which extends UserInterface.
3. [Assign roles to users](#assign-roles-to-users)

### Setup Module

[](#setup-module)

Configure the module in the modules section of your Yii configuration file.

```
'modules' => [
    'ticket' => [
        'class' => 'simialbi\yii2\ticket\Module',
        //'richTextFields' => true,
        //'kanbanModule' => 'kanban',
        //'smsProvider' => 'smsProvider',
        //'canAssignTicketsToNonAgents' => false,
        //'on ticketCreated' => function ($event) {},
        //[...]
    ]
]
```

#### Parameters

[](#parameters)

ParameterDescription`richTextFields`Set this parameter to true to use rich text fields. To do this you need to add `simialbi/yii2-summernote` to the require section of your composer.json.`kanbanModule`If you use the [Kanban Module](https://github.com/simialbi/yii2-kanban) too, you can put the id of the module here to use link functionality.`smsProvider`If you want to add SMS notification functionality, insert the sms component id here. It must implement `\simialbi\yii2\sms\ProviderInterface`.`canAssignTicketsToNonAgents`If set to true, agents can assign tickets to non agents#### Events

[](#events)

EventDescription`EVENT_TICKET_CREATED`Will be triggered after a new ticket was created.`EVENT_TICKET_UPDATED`Will be triggered after a ticket was updated.`EVENT_TICKET_ASSIGNED`Will be triggered after a ticket was assigned to an agent.`EVENT_TICKET_RESOLVED`Will be triggered after a ticket was resolved.`EVENT_TICKET_COMMENTED`Will be triggered after a ticket received a new comment.### Setup console config and apply migrations

[](#setup-console-config-and-apply-migrations)

Apply the migrations either with the following command: `yii migrate --migration-namespaces='simialbi\yii2\ticket\migrations'`or configure your console like this:

```
[
    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationNamespaces' => [
                'simialbi\yii2\ticket\migrations'
            ]
        ]
    ]
]
```

and apply the `yii migrate` command.

> Be sure to have an authManager configured. The migration process creates the needed roles by this module.

### Create identity

[](#create-identity)

Create an identity class which implements `simialbi\yii2\models\UserInterface` e.g.:

```
