https://github.com/linkorb/ticketbox-client
https://github.com/linkorb/ticketbox-client
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/linkorb/ticketbox-client
- Owner: linkorb
- License: mit
- Created: 2015-09-18T11:04:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-24T14:52:52.000Z (about 10 years ago)
- Last Synced: 2025-03-06T03:05:43.526Z (10 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TicketBox Client
Create tickets for TicketBox and view activities from your application
## Installation
```
composer require linkorb/ticketbox-client
```
## Example
Create Client
```php
require_once __DIR__ . '/../vendor/autoload.php';
use Linkorb\TicketBoxClient\Client as Client;
use Linkorb\TicketBoxClient\Ticket as Ticket;
// get the client
$client = new Client(
'http://tickets.dev/api/v1/',
,
);
```
Create Ticket by logged in User
```php
// Create Ticket with Logged in user
$ticket = new Ticket( $client ); // padidng client
$ticket->setSubject();
$ticket->setDescription();
try {
$ticket->create();
} catch( Exception $e ) {
echo $e->getMessage();
}
```
Create ticket by Anonymous user
```php
// Create Anon Ticket
$ticket = new Ticket( $client );
$ticket->setSubject();
$ticket->setDescription();
$ticket->setUser();
$ticket->setEmail();
$ticket->setPhone();
$ticket->setOrg();
try {
$ticket->create();
} catch( Exception $e ) {
echo $e->getMessage();
}
```
Get Ticket & its activities
```php
// Create Anon Ticket
$ticket = new Ticket( $client );
$ticket->get();
echo $ticket->getSubject(); // all the field null if not found.
$activities = $ticket->getActivity(); // get activities
var_dump($activities);
```
Change status of ticket
```php
// Get ticket
$ticket = new Ticket( $client );
$ticket->get(5);
try {
$ticket->setPending();
// $ticket->setClose();
// $ticket->setSchedule();
} catch ( Exception $e ) {
echo $e->getMessage();
}
```
Message ticket
```php
// Get ticket
$ticket = new Ticket( $client );
$ticket->get();
try {
$ticket->message( );
} catch ( Exception $e ) {
echo $e->getMessage();
}
```
Transfer Ticket
```php
// Get ticket
$ticket = new Ticket( $client );
$ticket->get();
try {
$ticket->transfer();
} catch ( Exception $e ) {
echo $e->getMessage();
}
```
## Brought to you by the LinkORB Engineering team

Check out our other projects at [engineering.linkorb.com](http://engineering.linkorb.com).
Btw, we're hiring!