/**
  * getform
  * @param type Help_topic $topic 
  * @return type
  */
 public function getForm(Help_topic $topic)
 {
     if (\Config::get('database.install') == '%0%') {
         return \Redirect::route('license');
     }
     if (System::first()->status == 1) {
         $topics = $topic->get();
         return view('themes.default1.client.helpdesk.form', compact('topics'));
     } else {
         return \Redirect::route('home');
     }
 }
 public function create(Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, User $agent, Sla_plan $sla)
 {
     try {
         $departments = $department->get();
         $topics = $topic->get();
         $forms = $form->get();
         $agents = $agent->where('role', '=', 'agent')->get();
         $slas = $sla->get();
         $priority = $priority->get();
         return view('themes.default1.admin.helpdesk.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
     } catch (Exception $e) {
         return view('404');
     }
 }
 /**
  * Show the form for editing the specified resource.
  * @param type int $id
  * @param type Department $department
  * @param type Help_topic $help
  * @param type Emails $email
  * @param type Priority $priority
  * @param type MailboxProtocol $mailbox_protocol
  * @return type Response
  */
 public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $priority, MailboxProtocol $mailbox_protocol)
 {
     try {
         $emails = $email->whereId($id)->first();
         $departments = $department->get();
         $helps = $help->get();
         $priority = $priority->get();
         $mailbox_protocols = $mailbox_protocol->get();
         return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails'));
     } catch (Exception $e) {
         return view('404');
     }
 }
 /**
  * get the form for Ticket setting page
  * @param type Ticket $ticket
  * @param type Sla_plan $sla
  * @param type Help_topic $topic
  * @param type Priority $priority
  * @return type Response
  */
 public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority)
 {
     try {
         /* fetch the values of ticket from ticket table */
         $tickets = $ticket->whereId('1')->first();
         /* Fetch the values from SLA Plan table */
         $slas = $sla->get();
         /* Fetch the values from Help_topic table */
         $topics = $topic->get();
         /* Direct to Ticket Settings Page */
         return view('themes.default1.admin.helpdesk.settings.ticket', compact('tickets', 'slas', 'topics', 'priority'));
     } catch (Exception $e) {
         return view('404');
     }
 }