This is a simple PHP Client that can connect to the TeamworkDesk API. This package was developed to be used with Laravel 5 but can also be used stand alone as well. I hope this helps you automate and extend TeamworkDesk to integrate even more into your business! Have fun and good luck. 🤘
This fork also includes updates for laravel 5.5 and 5.6
Just add this to your composer.json
and then run composer update
.
"nigelheap/teamwork-desk": "1.0.*"
You can also simply add it like this
composer require "nigelheap/teamwork-desk:1.0.*"
This wrapper comes with support for Laravel 5
. This includes a service provider as well as a facade for easy access.
Once this package is pulled into your project just add this to your config/app.php
file.
'providers' => [
...
'NigelHeap\TeamworkDesk\TeamworkDeskServiceProvider',
],
and then add the facade to your aliases
array
'aliases' => [
...
'TeamworkDesk' => 'NigelHeap\TeamworkDesk\Facades\TeamworkDesk',
],
If you are using Laravel then add a teamwork
array to your config/services.php
file
...
'teamwork-desk' => [
'key' => 'YourSecretKey',
'url' => 'YourTeamworkDeskUrl'
],
If you are using the Facade with Laravel youc an easily access TeamworkDesk like this
TeamworkDesk::customers()->all();
If you want to use dependency injection to make your application easy to test the Service Provider binds NigelHeap\TeamworkDesk\Factory
. Here is an example of how to use it with dependency injection
Route::get('/test', function(NigelHeap\TeamworkDesk\Factory $teamwork) {
$customers = $teamwork->customers()->all();
});
If you are not using Laravel you can instantiate the class like this
require "vendor/autoload.php";
use GuzzleHttp\Client as Guzzle;
use NigelHeap\TeamworkDesk\Client;
use NigelHeap\TeamworkDesk\Factory as TeamworkDesk;
$client = new Client(new Guzzle, 'YourSecretKey', 'YourTeamworkDeskUrl');
$teamwork = new TeamworkDesk($client);
You are ready to go now!
// get a customer
$teamwork->customers($customerId)->find();
// get a customers
$teamwork->customers()->all();
// get a tickets
$teamwork->tickets()->all();
// get a ticket
$teamwork->tickets($ticketId)->find();
// get a users
$teamwork->users()->all();
- Add Support For
Tickets
- Add Support For
Inboxes
- Add Support For
Customers
- Add Support For
Users
- Add Support For
Threads
- Add Support For
Happiness
- Add Support For
Users
- Add Support For
Categories
- Add Support For
People Status
- Add Support For
Files
- Add Support For
Features
- Add Support For
HelpDocs