updated commit
This commit is contained in:
@@ -1,25 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent;
|
||||
|
||||
<?php namespace App\Http\Controllers\Agent;
|
||||
use App;
|
||||
use App\Http\Controllers\Agent\TicketController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// use App\Model\Ticket\Ticket;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Ticket\Ticket_attachments;
|
||||
use App\Model\Ticket\Ticket_Thread;
|
||||
|
||||
/**
|
||||
* MailController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class MailController extends Controller {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $email = "";
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $stream = "";
|
||||
|
||||
// public function fetchEmails(Emails $email)
|
||||
// {
|
||||
// $emails = $email->get();
|
||||
// $mailboxes = $emails;
|
||||
// return $mailboxes;
|
||||
// }
|
||||
/**
|
||||
* constructor
|
||||
* Create a new controller instance.
|
||||
* @param type TicketController $TicketController
|
||||
*/
|
||||
public function __construct(TicketController $TicketController) {
|
||||
$this->TicketController = $TicketController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode Imap text
|
||||
* @param type $str
|
||||
* @return type string
|
||||
*/
|
||||
function decode_imap_text($str) {
|
||||
$result = '';
|
||||
$decode_header = imap_mime_header_decode($str);
|
||||
@@ -29,29 +48,75 @@ class MailController extends Controller {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Imap data
|
||||
*/
|
||||
function getdata() {
|
||||
/**
|
||||
* fetching all the emails allowed to
|
||||
* check for mails to read tickets
|
||||
*/
|
||||
$email = new Emails;
|
||||
$mailboxes = $email->get();
|
||||
|
||||
//check for any value in $mailbox
|
||||
if (count($mailboxes) >= 0) {
|
||||
foreach ($mailboxes as $current_mailbox) {
|
||||
//checking for fetching status of the emails
|
||||
if ($current_mailbox['fetching_status']) {
|
||||
/**
|
||||
*@imap_open requres three arguments for
|
||||
* reading mails in each emails
|
||||
*
|
||||
* 1. Host
|
||||
* 2. email address
|
||||
* 3. password
|
||||
*/
|
||||
$stream = @imap_open($current_mailbox['fetching_host'], $current_mailbox['email_address'], $current_mailbox['password']);
|
||||
/**
|
||||
* @var $testvar type string
|
||||
*/
|
||||
$testvar = "";
|
||||
// checking for any result in imap_open with value
|
||||
if ($stream >= 0) {
|
||||
$emails = imap_search($stream, 'SINCE ' . date('d-M-Y', strtotime("-10 day")));
|
||||
/**
|
||||
* @imap_search requires two arguments to check
|
||||
* from when to check for mails
|
||||
*
|
||||
* 1. result of @imap_open $stream
|
||||
* 2. date in negative
|
||||
*/
|
||||
$emails = imap_search($stream, 'SINCE ' . date('d-M-Y', strtotime("-1 day")));
|
||||
// checking if $emails has received any value
|
||||
if ($emails != false) {
|
||||
// count for mails
|
||||
if (count($emails) >= 0) {
|
||||
rsort($emails);
|
||||
foreach ($emails as $email_id) {
|
||||
/**
|
||||
* @imap_fetch_overview requires three arguments to check
|
||||
* the overview of each mails
|
||||
*
|
||||
* 1. result of @imap_open $stream
|
||||
* 2. emails numbers $emails_id
|
||||
* 3. and a 0 value
|
||||
*/
|
||||
$overview = imap_fetch_overview($stream, $email_id, 0);
|
||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||
if ($var == 'unread') {
|
||||
// check for unread messages
|
||||
if ($var == 'read') {
|
||||
$testvar = 'set';
|
||||
|
||||
/**
|
||||
* fetching overview details fo each mails
|
||||
*
|
||||
* 1. from address
|
||||
* 2. subject
|
||||
* 3. date and time
|
||||
*/
|
||||
$from = $this->decode_imap_text($overview[0]->from);
|
||||
$subject = $this->decode_imap_text($overview[0]->subject);
|
||||
$datetime = $overview[0]->date;
|
||||
// separate date and time
|
||||
$date_time = explode(" ", $datetime);
|
||||
$date = $date_time[1] . "-" . $date_time[2] . "-" . $date_time[3] . " " . $date_time[4];
|
||||
|
||||
@@ -68,26 +133,31 @@ class MailController extends Controller {
|
||||
// {
|
||||
// echo "fail";
|
||||
// }
|
||||
|
||||
$emailadd = explode('&', $from);
|
||||
$username = $emailadd[0];
|
||||
$emailadd = substr($emailadd[1], 3);
|
||||
$date = date('Y-m-d H:i:s', strtotime($date));
|
||||
|
||||
$system = "Email";
|
||||
$phone = "";
|
||||
$helptopic = $this->default_helptopic();
|
||||
$sla = $this->default_sla();
|
||||
|
||||
$helptopic = $this->TicketController->default_helptopic();
|
||||
$sla = $this->TicketController->default_sla();
|
||||
$structure = imap_fetchstructure($stream, $email_id);
|
||||
// $image1 = $structure->parts[0]->parts[1]->parameters[0]->value;
|
||||
// $image = $structure->parts[1]->parameters[0]->value;
|
||||
// echo '<img src="'.$image1.'">';
|
||||
// echo '<img src="'.$image.'">';
|
||||
// dd($structure);
|
||||
//=================================================
|
||||
// HTML
|
||||
//=================================================
|
||||
|
||||
/**
|
||||
* There are 5 types of mail readable formats
|
||||
*
|
||||
* 1. Html
|
||||
* 2. Alternative
|
||||
* 3. Related
|
||||
* 4. Mixed
|
||||
*/
|
||||
|
||||
// checking if the format is Html
|
||||
if ($structure->subtype == 'HTML') {
|
||||
$body2 = imap_fetchbody($stream, $email_id, 1);
|
||||
if ($body2 == null) {
|
||||
@@ -98,10 +168,7 @@ class MailController extends Controller {
|
||||
// echo $body;
|
||||
// echo "0";
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// ALTERNATIVE
|
||||
//=================================================
|
||||
// checking if the format is Alternative
|
||||
if ($structure->subtype == 'ALTERNATIVE') {
|
||||
if (isset($structure->parts)) {
|
||||
$body2 = imap_fetchbody($stream, $email_id, 1.2);
|
||||
@@ -113,10 +180,7 @@ class MailController extends Controller {
|
||||
// echo $body[0];
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// RELATED
|
||||
//=================================================
|
||||
// checking if the format is related
|
||||
if ($structure->subtype == 'RELATED') {
|
||||
if (isset($structure->parts)) {
|
||||
$parts = $structure->parts;
|
||||
@@ -126,10 +190,8 @@ class MailController extends Controller {
|
||||
$body2 = imap_fetchbody($stream, $email_id, 1);
|
||||
}
|
||||
$body = quoted_printable_decode($body2);
|
||||
|
||||
foreach ($parts as $part) {
|
||||
if ($parts[$i]) {
|
||||
|
||||
}
|
||||
$i++;
|
||||
if (isset($parts[$i])) {
|
||||
@@ -142,7 +204,6 @@ class MailController extends Controller {
|
||||
if (strtolower($object->attribute) == 'filename') {
|
||||
$filename = $object->value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if ($parts[$i]->ifparameters == 1) {
|
||||
@@ -150,7 +211,6 @@ class MailController extends Controller {
|
||||
if (strtolower($object->attribute) == 'name') {
|
||||
$name = $object->value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$body = str_replace($imageid, $filename, $body);
|
||||
@@ -170,10 +230,7 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// MIXED
|
||||
//=================================================
|
||||
//checking if the format is mixed
|
||||
elseif ($structure->subtype == 'MIXED') {
|
||||
if (isset($structure->parts)) {
|
||||
$parts = $structure->parts;
|
||||
@@ -188,7 +245,6 @@ class MailController extends Controller {
|
||||
$body = quoted_printable_decode($body2);
|
||||
}
|
||||
}
|
||||
|
||||
// subtype = RELATED
|
||||
if ($parts[0]->subtype == 'RELATED') {
|
||||
if (isset($parts[0]->parts)) {
|
||||
@@ -203,7 +259,6 @@ class MailController extends Controller {
|
||||
$name = "";
|
||||
foreach ($parts as $part) {
|
||||
if ($parts[0]) {
|
||||
|
||||
}
|
||||
$i++;
|
||||
if (isset($parts[$i])) {
|
||||
@@ -249,8 +304,8 @@ class MailController extends Controller {
|
||||
// $ticket->body = $body2;
|
||||
// $ticket->date = $datetime;
|
||||
// $ticket->save();
|
||||
|
||||
if ($this->create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $system) == true) {
|
||||
$priority = '1';
|
||||
if ($this->TicketController->create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $priority, $system) == true) {
|
||||
$thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||
$thread_id = $thread_id->id;
|
||||
if ($this->get_attachment($structure, $stream, $email_id, $thread_id) == true) {
|
||||
@@ -270,10 +325,16 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//======================================
|
||||
// ATTACHMENT |Incomplete
|
||||
//======================================
|
||||
/**
|
||||
* Get attachments data from mail
|
||||
* @param type $structure
|
||||
* @param type $stream
|
||||
* @param type $email_id
|
||||
* @param type $thread_id
|
||||
* @return type bool
|
||||
*/
|
||||
public function get_attachment($structure, $stream, $email_id, $thread_id) {
|
||||
// checking if the mails has attachments
|
||||
if (isset($structure->parts) && count($structure->parts)) {
|
||||
for ($i = 0; $i < count($structure->parts); $i++) {
|
||||
$attachments[$i] = array(
|
||||
@@ -281,7 +342,7 @@ class MailController extends Controller {
|
||||
'filename' => '',
|
||||
'name' => '',
|
||||
'attachment' => '');
|
||||
|
||||
// checking for files
|
||||
if ($structure->parts[$i]->ifdparameters) {
|
||||
foreach ($structure->parts[$i]->dparameters as $object) {
|
||||
if (strtolower($object->attribute) == 'filename') {
|
||||
@@ -290,6 +351,7 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
// checking for files
|
||||
if ($structure->parts[$i]->ifparameters) {
|
||||
foreach ($structure->parts[$i]->parameters as $object) {
|
||||
if (strtolower($object->attribute) == 'name') {
|
||||
@@ -298,8 +360,12 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* All over again checking for the availability of attachment
|
||||
*/
|
||||
if ($attachments[$i]['is_attachment']) {
|
||||
$attachments[$i]['attachment'] = imap_fetchbody($stream, $email_id, $i + 1);
|
||||
// decoding if encoded in base64_encode format else quoted_printable_encode
|
||||
if ($structure->parts[$i]->encoding == 3) {
|
||||
$attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']);
|
||||
} elseif ($structure->parts[$i]->encoding == 4) {
|
||||
@@ -307,15 +373,19 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
// calling the save method to save each attachments
|
||||
if ($this->save_attcahments($attachments, $thread_id) == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=====================================
|
||||
// SAVE ATTACHMENT | Incomplete
|
||||
//=====================================
|
||||
/**
|
||||
* Function to save attachments
|
||||
* @param type $attachments
|
||||
* @param type $thread_id
|
||||
* @return type bool
|
||||
*/
|
||||
public function save_attcahments($attachments, $thread_id) {
|
||||
if (count($attachments) != 0) {
|
||||
foreach ($attachments as $at) {
|
||||
@@ -324,7 +394,6 @@ class MailController extends Controller {
|
||||
$filename = $at['filename'];
|
||||
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
$tmpName = $at['filename'];
|
||||
// echo '<img src="'.$tmpName.'">';
|
||||
$fp = fopen($tmpName, 'r');
|
||||
$content = fread($fp, filesize($tmpName));
|
||||
$content2 = file_put_contents($at['filename'], $at['attachment']);
|
||||
@@ -334,300 +403,11 @@ class MailController extends Controller {
|
||||
$ticket_Thread->name = $filename;
|
||||
$ticket_Thread->size = $filesize;
|
||||
$ticket_Thread->type = $ext;
|
||||
$ticket_Thread->content = $fp; //$content;
|
||||
$ticket_Thread->content = $fp;
|
||||
$ticket_Thread->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// // public function part($part)
|
||||
// // {
|
||||
// // $structure = $part->parts;
|
||||
// // return $structure;
|
||||
// // }
|
||||
// // public function fetchdata()
|
||||
// // {
|
||||
// // $tickets = Tickets::all();
|
||||
// // foreach ($tickets as $ticket)
|
||||
// // {
|
||||
// // echo $ticket->body.'<hr/>';
|
||||
// // }
|
||||
// // }
|
||||
// public function ticket_list()
|
||||
// {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
// return view('themes.default1.agent.ticket.ticket',compact('tickets'),compact('threads'));
|
||||
// }
|
||||
// public function thread($id)
|
||||
// {
|
||||
// $tickets = Tickets::where('id','=',$id)->first();
|
||||
// $thread = Ticket_Thread::where('ticket_id','=',$id)->first();
|
||||
// return view('themes.default1.agent.ticket.timeline',compact('tickets'),compact('thread'));
|
||||
// }
|
||||
// //============================================
|
||||
// // Create Ticket | Incomplete
|
||||
// //============================================
|
||||
// public function reply(Ticket_Thread $thread, TicketRequest $request)
|
||||
// {
|
||||
// $thread->ticket_id = $request->input('ticket_ID');
|
||||
// $thread->title = $request->input('To');
|
||||
// $thread->body = $request->input('ReplyContent');
|
||||
// $thread->save();
|
||||
// $ticket_id = $request->input('ticket_ID');
|
||||
// $tickets = Tickets::where('id','=',$ticket_id)->first();
|
||||
// $thread = Ticket_Thread::where('ticket_id','=',$ticket_id)->first();
|
||||
// // return 'success';
|
||||
// return Redirect("thread/".$ticket_id);
|
||||
// }
|
||||
// //============================================
|
||||
// // Ticket Edit get | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_edit_get($id, Tickets $ticket , Ticket_Thread $thread)
|
||||
// {
|
||||
// $ticket_id = $ticket->where('id' , '=' , $id)->first();
|
||||
// $thread_id = $thread->where('ticket_id' , '=' , $id)->first();
|
||||
// $user = User::where('id' , '=' , $ticket_id->user_id)->first();
|
||||
// return view("themes.default1.agent.ticket.edit",compact('ticket_id','thread_id','user'));
|
||||
// }
|
||||
// //============================================
|
||||
// // Ticket Edit post | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_edit_post($ticket_id,Ticket_Thread $thread)
|
||||
// {
|
||||
// dd($ticket_id);
|
||||
// // return Redirect("");
|
||||
// }
|
||||
// //============================================
|
||||
// // Ticket print | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_print($id)
|
||||
// {
|
||||
// return pdf();
|
||||
// // return Redirect("");
|
||||
// }
|
||||
// //============================================
|
||||
// // Generate Ticket Number | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_number($ticket_number)
|
||||
// {
|
||||
// $number = $ticket_number;
|
||||
// $number = explode('-',$number);
|
||||
// $number1 = $number[0];
|
||||
// if($number1 == 'ZZZZ'){
|
||||
// $number1 = 'AAAA';
|
||||
// }
|
||||
// $number2 = $number[1];
|
||||
// if($number2 == '9999'){
|
||||
// $number2 = '0000';
|
||||
// }
|
||||
// $number3 = $number[2];
|
||||
// if($number3 == '9999999'){
|
||||
// $number3 = '0000000';
|
||||
// }
|
||||
// $number1++;
|
||||
// $number2++;
|
||||
// $number3++;
|
||||
// $number2 = sprintf('%04s', $number2);
|
||||
// $number3 = sprintf('%07s', $number3);
|
||||
// $array = array($number1,$number2,$number3);
|
||||
// $number = implode('-', $array);
|
||||
// return $number;
|
||||
// }
|
||||
// //=============================================
|
||||
// // Checking email availability | Complete
|
||||
// //=============================================
|
||||
// public function check_email($email)
|
||||
// {
|
||||
// $check = User::where('email','=',$email)->first();
|
||||
// if($check == true)
|
||||
// {
|
||||
// return $check;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// //===============================================
|
||||
// // Create User | InComplete
|
||||
// //===============================================
|
||||
// public function create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $system)
|
||||
// {
|
||||
// $email;
|
||||
// $username;
|
||||
// $checkemail = $this->check_email($emailadd);
|
||||
// if($checkemail == false )
|
||||
// {
|
||||
// $password = $this->generateRandomString();
|
||||
// $user = new User;
|
||||
// $user->user_name = $username;
|
||||
// $user->email = $emailadd;
|
||||
// $user->password = Hash::make($password);
|
||||
// if($user->save())
|
||||
// {
|
||||
// $user_id = $user->id;
|
||||
// if(Mail::send('emails.pass', ['password' => $password, 'name' => $username],
|
||||
// function($message)use($emailadd, $username)
|
||||
// {
|
||||
// $message->to($emailadd, $username)->subject('password');
|
||||
// }))
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $username = $checkemail->username;
|
||||
// $user_id = $checkemail->id;
|
||||
// }
|
||||
// $ticket_number = $this->check_ticket($user_id, $subject, $body, $helptopic, $sla);
|
||||
// if(Mail::send('emails.Ticket_Create', ['name' => $username, 'ticket_number' => $ticket_number],
|
||||
// function($message)use($emailadd, $username, $ticket_number)
|
||||
// {
|
||||
// $message->to($emailadd, $username)->subject('[~'.$ticket_number.']');
|
||||
// }))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Select Default help_topic | Incomplete
|
||||
// //============================================
|
||||
// public function default_helptopic()
|
||||
// {
|
||||
// $helptopic = "Support";
|
||||
// return $helptopic;
|
||||
// }
|
||||
// //============================================
|
||||
// // Select Default sla | Incomplete
|
||||
// //============================================
|
||||
// public function default_sla()
|
||||
// {
|
||||
// $sla = "12hours";
|
||||
// return $sla;
|
||||
// }
|
||||
// //============================================
|
||||
// // Select Default priority | Incomplete
|
||||
// //============================================
|
||||
// public function default_priority()
|
||||
// {
|
||||
// $priority = "important";
|
||||
// return $helptopic;
|
||||
// }
|
||||
// //============================================
|
||||
// // check ticket | Incomplete
|
||||
// //============================================
|
||||
// public function check_ticket($user_id, $subject, $body, $helptopic, $sla)
|
||||
// {
|
||||
// $read_ticket_number = substr($subject, 0, 6);
|
||||
// if($read_ticket_number == 'Re: [~')
|
||||
// {
|
||||
// $separate = explode("]", $subject);
|
||||
// $new_subject = substr($separate[0] , 6 , 20);
|
||||
// $find_number = Tickets::where('ticket_number', '=', $new_subject)->first();
|
||||
// $thread_body = explode("---Reply above this line---", $body);
|
||||
// $body = $thread_body[0];
|
||||
// if(count($find_number) > 0)
|
||||
// {
|
||||
// $id = $find_number->id;
|
||||
// $ticket_number = $find_number->ticket_number;
|
||||
// if(isset($id))
|
||||
// {
|
||||
// if($this->ticket_thread($subject, $body, $id, $user_id))
|
||||
// {
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $ticket_number = $this->create_ticket($user_id, $subject, $body, $helptopic, $sla);
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $ticket_number = $this->create_ticket($user_id, $subject, $body, $helptopic, $sla);
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Create Ticket | Incomplete
|
||||
// //============================================
|
||||
// public function create_ticket($user_id, $subject, $body, $helptopic, $sla)
|
||||
// {
|
||||
// $max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->get();
|
||||
// foreach($max_number as $number)
|
||||
// {
|
||||
// $ticket_number = $number->ticket_number;
|
||||
// }
|
||||
// $ticket = new Tickets;
|
||||
// $ticket->ticket_number = $this->ticket_number($ticket_number);
|
||||
// $ticket->user_id = $user_id;
|
||||
// $ticket->save();
|
||||
// $ticket_number = $ticket->ticket_number;
|
||||
// $id = $ticket->id;
|
||||
// if($this->ticket_thread($subject, $body, $id, $user_id)==true)
|
||||
// {
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Create Ticket | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_thread($subject, $body, $id, $user_id)
|
||||
// {
|
||||
// $thread = new Ticket_Thread;
|
||||
// $thread->user_id = $user_id;
|
||||
// $thread->ticket_id = $id;
|
||||
// $thread->poster = 'client';
|
||||
// $thread->title = $subject;
|
||||
// $thread->body = $body;
|
||||
// if($thread->save())
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Generate Random password | Incomplete
|
||||
// //============================================
|
||||
// public function generateRandomString($length = 10)
|
||||
// {
|
||||
// $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
// $charactersLength = strlen($characters);
|
||||
// $randomString = '';
|
||||
// for ($i = 0; $i < $length; $i++)
|
||||
// {
|
||||
// $randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
// }
|
||||
// return $randomString;
|
||||
// }
|
||||
// public function close($id, Tickets $ticket)
|
||||
// {
|
||||
// $ticket_status = $ticket->where('id','=',$id)->first();
|
||||
// $ticket_status->status = 3;
|
||||
// $ticket_status->save();
|
||||
// return "your ticket".$ticket_status->ticket_number." has been closed";
|
||||
// }
|
||||
// public function resolve($id, Tickets $ticket)
|
||||
// {
|
||||
// $ticket_status = $ticket->where('id','=',$id)->first();
|
||||
// $ticket_status->status = 2;
|
||||
// $ticket_status->save();
|
||||
// return "your ticket".$ticket_status->ticket_number." has been resolved";
|
||||
// }
|
||||
// public function open($id, Tickets $ticket)
|
||||
// {
|
||||
// $ticket_status = $ticket->where('id','=',$id)->first();
|
||||
// $ticket_status->status = 1;
|
||||
// $ticket_status->save();
|
||||
// return "your ticket".$ticket_status->ticket_number." has been opened";
|
||||
// }
|
||||
// public function assign($id)
|
||||
// {
|
||||
// return $id;
|
||||
// }
|
||||
}
|
||||
|
Reference in New Issue
Block a user