Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2018-08-06 05:18:13 +00:00
committed by StyleCI Bot
parent 4ec6000d69
commit c547b2e438
41 changed files with 373 additions and 308 deletions

View File

@@ -61,6 +61,7 @@ class ApiController extends Controller
$this->middleware('jwt.auth');
$this->middleware('api', ['except' => 'GenerateApiKey']);
try {
$user = \JWTAuth::parseToken()->authenticate();
$this->user = $user;
@@ -1092,7 +1093,7 @@ class ApiController extends Controller
$result = $this->user->join('tickets', function ($join) use ($id) {
$join->on('users.id', '=', 'tickets.assigned_to')
->where('status', '=', 1);
//->where('user_id', '=', $id);
//->where('user_id', '=', $id);
})
->join('department', 'department.id', '=', 'tickets.dept_id')
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
@@ -1288,6 +1289,7 @@ class ApiController extends Controller
public function collaboratorSearch()
{
$this->validate($this->request, ['term' => 'required']);
try {
$emails = $this->ticket->autosearch();
//return $emails;

View File

@@ -329,12 +329,12 @@ class TicketController extends Controller
// Mail::send(array('html' => 'emails.ticket_re-reply'), ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $username, 'Agent_Signature' => $agentsign], function ($message) use ($email, $user_name, $ticket_number, $ticket_subject, $check_attachment) {
// $message->to($email, $user_name)->subject($ticket_subject . '[#' . $ticket_number . ']');
// // if(isset($attachments)){
// // if ($check_attachment == 1) {
// // $size = count($attach);
// // for ($i = 0; $i < $size; $i++) {
// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]);
// // }
// // }
// // if ($check_attachment == 1) {
// // $size = count($attach);
// // for ($i = 0; $i < $size; $i++) {
// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]);
// // }
// // }
// }, true);
//dd('reply');
/*
@@ -361,12 +361,12 @@ class TicketController extends Controller
}
// Mail::send('emails.ticket_re-reply', ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $collab_user_name, 'Agent_Signature' => $agentsign], function ($message) use ($collab_email, $collab_user_name, $ticket_number, $ticket_subject, $check_attachment) {
// $message->to($collab_email, $collab_user_name)->subject($ticket_subject . '[#' . $ticket_number . ']');
// // if ($check_attachment == 1) {
// // $size = sizeOf($attachments);
// // for ($i = 0; $i < $size; $i++) {
// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]);
// // }
// // }
// // if ($check_attachment == 1) {
// // $size = sizeOf($attachments);
// // for ($i = 0; $i < $size; $i++) {
// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]);
// // }
// // }
// }, true);
try {
@@ -713,6 +713,7 @@ class TicketController extends Controller
return $collab;
} catch (\Exception $ex) {
return $ex->getMessage();
throw new \Exception('get collaborator for ticket fails');
}
}

View File

@@ -47,7 +47,7 @@ class TokenAuthController extends Controller
$password = $request->input('password');
$field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name';
//$credentials = $request->only('email', 'password');
//$credentials = $request->only('email', 'password');
try {
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active'=>1])) {
@@ -62,7 +62,7 @@ class TokenAuthController extends Controller
}
$user_id = \Auth::user()->id;
// if no errors are encountered we can return a JWT
// if no errors are encountered we can return a JWT
return response()->json(compact('token', 'user_id'));
}
@@ -89,7 +89,7 @@ class TokenAuthController extends Controller
return response()->json(compact('error'));
}
//dd($user);
//dd($user);
return response()->json(compact('user'));
}