Created
March 13, 2016 14:32
-
-
Save PureSingh/0fe8ae4663fc825e5847 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use Cache; | |
// use Zendesk\API\HttpClient as Zendesk; | |
use Flash; | |
// use Huddle\Zendesk\Services\ZendeskService as Zendesk; | |
// use App\Facades\Zendesk as Zendesk; | |
use Facades; | |
use Huddle\Zendesk\Services\ZendeskService; | |
class HomeController extends Controller | |
{ | |
public function __construct(ZendeskService $zendesk_service) { | |
$this->zendesk_service = $zendesk_service; | |
} | |
public function addTicket() { | |
$this->zendesk_service->tickets()->create([ | |
'subject' => 'Subject', | |
'comment' => [ | |
'body' => 'Ticket content.' | |
], | |
'priority' => 'normal' | |
]); | |
} | |
public function index() { | |
$page_title = "Home"; | |
$page_description = "This is the home page"; | |
$ztickets = $this->zendesk_service->tickets()->findAll(); | |
$tickets = $ztickets->tickets; | |
$ticket = ''; | |
return view('home', compact('page_title', 'page_description', 'tickets')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment