Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -87,7 +87,7 @@ class AgentController extends Controller
// get all department
$departments = $department->get();
// list all the teams in a single variable
$teams = $team->lists('id', 'name')->toArray();
$teams = $team->pluck('id', 'name')->toArray();
$location = GeoIP::getLocation();
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
// returns to the page with all the variables and their datas
@@ -187,13 +187,13 @@ class AgentController extends Controller
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
$user = $user->whereId($id)->first();
$team = $team->where('status', '=', 1)->get();
$teams1 = $team->lists('name', 'id');
$teams1 = $team->pluck('name', 'id');
$timezones = $timezone->get();
$groups = $group->where('group_status', '=', 1)->get();
$departments = $department->get();
$table = $team_assign_agent->where('agent_id', $id)->first();
$teams = $team->lists('id', 'name')->toArray();
$assign = $team_assign_agent->where('agent_id', $id)->lists('team_id')->toArray();
$teams = $team->pluck('id', 'name')->toArray();
$assign = $team_assign_agent->where('agent_id', $id)->pluck('team_id')->toArray();
return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'))->with('phonecode', $phonecode->phonecode);
} catch (Exception $e) {

View File

@@ -84,7 +84,7 @@ class DepartmentController extends Controller
$emails = $email->select('email_name', 'id')->get();
$templates = $template->get();
$department = $department->get();
$groups = $group->lists('id', 'name');
$groups = $group->pluck('id', 'name');
return view('themes.default1.admin.helpdesk.agent.departments.create', compact('department', 'templates', 'slas', 'user', 'emails', 'groups'));
} catch (Exception $e) {
@@ -164,8 +164,8 @@ class DepartmentController extends Controller
$emails = $email->select('email_name', 'id')->get();
$templates = $template->get();
$departments = $department->whereId($id)->first();
//$groups = $group->lists('id', 'name');
$assign = $group_assign_department->where('department_id', $id)->lists('group_id');
//$groups = $group->pluck('id', 'name');
$assign = $group_assign_department->where('department_id', $id)->pluck('group_id');
return view('themes.default1.admin.helpdesk.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'sys_department'));
} catch (Exception $e) {

View File

@@ -82,7 +82,7 @@ class EmailsController extends Controller
$mailbox_protocols = $mailbox_protocol->get();
$service = new \App\Model\MailJob\MailService();
$services = $service->lists('name', 'id')->toArray();
$services = $service->pluck('name', 'id')->toArray();
// return with all the table data
return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'services'));
@@ -351,7 +351,7 @@ class EmailsController extends Controller
$mailbox_protocols = $mailbox_protocol->get();
$service = new \App\Model\MailJob\MailService();
$services = $service->lists('name', 'id')->toArray();
$services = $service->pluck('name', 'id')->toArray();
// return if the execution is succeeded
return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails', 'sys_email', 'services'))->with('count', $count);

View File

@@ -190,7 +190,7 @@ class FormController extends Controller
try {
$forms = new Forms();
$form = $forms->find($id);
$select_forms = $forms->where('id', '!=', $id)->lists('formname', 'id')->toArray();
$select_forms = $forms->where('id', '!=', $id)->pluck('formname', 'id')->toArray();
//dd($form);
if ($form) {
$fields = $form->fields();
@@ -209,7 +209,7 @@ class FormController extends Controller
try {
$forms = new Forms();
$form = $forms->find($id);
$select_forms = $forms->where('id', '!=', $id)->lists('formname', 'id')->toArray();
$select_forms = $forms->where('id', '!=', $id)->pluck('formname', 'id')->toArray();
//dd($form);
if ($form) {
$fields = $form->fields();
@@ -541,7 +541,7 @@ class FormController extends Controller
$session = self::getSession();
$script = self::jqueryScript($field_value = '', $field->id, $field->name, $field_type);
$form_hidden = Form::hidden('fieldid[]', $field->id, ['id' => 'hidden'.$session.$field->id]).Form::label($field->label, $field->label, ['class' => $required_class]);
$select = Form::$field_type($field->name, ['' => 'Select', 'Selects' => self::removeUnderscoreFromDB($field->values()->lists('field_value', 'field_value')->toArray())], null, ['class' => "form-control $session$field->id", 'id' => $session.$field->id, 'required' => $required]).'</br>';
$select = Form::$field_type($field->name, ['' => 'Select', 'Selects' => self::removeUnderscoreFromDB($field->values()->pluck('field_value', 'field_value')->toArray())], null, ['class' => "form-control $session$field->id", 'id' => $session.$field->id, 'required' => $required]).'</br>';
$html = $script.$form_hidden.$select;
$response_div = '<div id='.$session.$field->name.'></div>';
@@ -552,7 +552,7 @@ class FormController extends Controller
{
$radio = '';
$html = '';
$values = $field->values()->lists('field_value')->toArray();
$values = $field->values()->pluck('field_value')->toArray();
if (count($values) > 0) {
foreach ($values as $field_value) {
$script = self::jqueryScript($field_value, $field->id, $field->name, $field_type);
@@ -570,7 +570,7 @@ class FormController extends Controller
$session = self::getSession();
$checkbox = '';
$html = '';
$values = $field->values()->lists('field_value')->toArray();
$values = $field->values()->pluck('field_value')->toArray();
if (count($values) > 0) {
$i = 1;
foreach ($values as $field_value) {

View File

@@ -48,7 +48,7 @@ class GroupController extends Controller
{
try {
$groups = $group->get();
$departments = $department->lists('id');
$departments = $department->pluck('id');
return view('themes.default1.admin.helpdesk.agent.groups.index', compact('departments', 'group_assign_department', 'groups'));
} catch (Exception $e) {

View File

@@ -49,7 +49,7 @@ class TeamController extends Controller
try {
$teams = $team->get();
/* find out the Number of Members in the Team */
$id = $teams->lists('id');
$id = $teams->pluck('id');
$assign_team_agent = $assign_team_agent->get();
return view('themes.default1.admin.helpdesk.agent.teams.index', compact('assign_team_agent', 'teams'));
@@ -213,7 +213,7 @@ class TeamController extends Controller
$a_id = [];
$teams = $team->whereId($id)->first();
$agent_team = $assign_team_agent->where('team_id', $id)->get();
$agent_id = $agent_team->lists('agent_id', 'agent_id');
$agent_id = $agent_team->pluck('agent_id', 'agent_id');
foreach ($agent_id as $value) {
array_push($a_id, $value);
}

View File

@@ -145,7 +145,7 @@ class WorkflowController extends Controller
public function create(Emails $emails)
{
$email_data = '';
foreach ($emails->lists('email_address', 'id') as $key => $email) {
foreach ($emails->pluck('email_address', 'id') as $key => $email) {
$email_data["E-$key"] = $email;
}
$emails = $email_data;

View File

@@ -67,7 +67,7 @@ class FilterController extends Controller
}
}
})
->lists('ticket_id')
->pluck('ticket_id')
->toArray();
return $query;

View File

@@ -1763,7 +1763,7 @@ class TicketController extends Controller
public function autosearch($id)
{
$term = \Input::get('term');
$user = \App\User::where('email', 'LIKE', '%'.$term.'%')->lists('email');
$user = \App\User::where('email', 'LIKE', '%'.$term.'%')->pluck('email');
echo json_encode($user);
}
@@ -1776,7 +1776,7 @@ class TicketController extends Controller
*/
public function autosearch2(User $user)
{
$user = $user->lists('email');
$user = $user->pluck('email');
echo json_encode($user);
}

View File

@@ -257,7 +257,7 @@ class UserController extends Controller
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
$location = GeoIP::getLocation();
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
$org = Organization::lists('name', 'id')->toArray();
$org = Organization::pluck('name', 'id')->toArray();
return view('themes.default1.agent.helpdesk.user.create', compact('org', 'settings', 'email_mandatory'))->with('phonecode', $phonecode->phonecode);
} catch (Exception $e) {
@@ -647,9 +647,9 @@ class UserController extends Controller
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
$orgs = Organization::all();
// dd($org);
$organization_id = User_org::where('user_id', '=', $id)->lists('org_id')->first();
$organization_id = User_org::where('user_id', '=', $id)->pluck('org_id')->first();
// $org_name=Organization::where('id','=',$org_id)->lists('name')->first();
// $org_name=Organization::where('id','=',$org_id)->pluck('name')->first();
// dd($org_name);
return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'orgs', '$settings', '$email_mandatory', 'organization_id'))->with('phonecode', $phonecode->phonecode);
@@ -833,7 +833,7 @@ class UserController extends Controller
$org_name = Input::get('org');
if ($org_name) {
$org = Organization::where('name', '=', $org_name)->lists('id')->first();
$org = Organization::where('name', '=', $org_name)->pluck('id')->first();
if ($org) {
$user_org = new User_org();
$user_org->org_id = $org;
@@ -854,7 +854,7 @@ class UserController extends Controller
$org_name = Input::get('org');
if ($org_name) {
$org = Organization::where('name', '=', $org_name)->lists('id')->first();
$org = Organization::where('name', '=', $org_name)->pluck('id')->first();
if ($org) {
$user_org = User_org::where('user_id', '=', $id)->first();
$user_org->org_id = $org;

View File

@@ -134,7 +134,7 @@ class ArticleController extends Controller
public function create(Category $category)
{
/* get the attributes of the category */
$category = $category->lists('id', 'name');
$category = $category->pluck('id', 'name');
/* get the create page */
try {
return view('themes.default1.agent.kb.article.create', compact('category'));
@@ -196,9 +196,9 @@ class ArticleController extends Controller
$aid = $article->where('id', $slug)->first();
$id = $aid->id;
/* define the selected fields */
$assign = $relation->where('article_id', $id)->lists('category_id');
$assign = $relation->where('article_id', $id)->pluck('category_id');
/* get the attributes of the category */
$category = $category->lists('id', 'name');
$category = $category->pluck('id', 'name');
/* get the selected article and display it at edit page */
/* Get the selected article with id */
$article = $article->whereId($id)->first();

View File

@@ -121,7 +121,7 @@ class CategoryController extends Controller
public function create(Category $category)
{
/* Get the all attributes in the category model */
$category = $category->lists('name', 'id')->toArray();
$category = $category->pluck('name', 'id')->toArray();
/* get the view page to create new category with all attributes
of category model */
try {
@@ -167,7 +167,7 @@ class CategoryController extends Controller
{
/* get the atributes of the category model whose id == $id */
$category = Category::whereId($id)->first();
$categories = Category::lists('name', 'id')->toArray();
$categories = Category::pluck('name', 'id')->toArray();
/* get the Edit page the selected category via id */
return view('themes.default1.agent.kb.category.edit', compact('category', 'categories'));
}

View File

@@ -627,7 +627,7 @@ class TicketController extends Controller
public function autosearch()
{
$term = \Input::get('term');
$user = \App\User::where('email', 'LIKE', '%'.$term.'%')->orWhere('first_name', 'LIKE', '%'.$term.'%')->orWhere('last_name', 'LIKE', '%'.$term.'%')->orWhere('user_name', 'LIKE', '%'.$term.'%')->lists('email');
$user = \App\User::where('email', 'LIKE', '%'.$term.'%')->orWhere('first_name', 'LIKE', '%'.$term.'%')->orWhere('last_name', 'LIKE', '%'.$term.'%')->orWhere('user_name', 'LIKE', '%'.$term.'%')->pluck('email');
return $user;
}

View File

@@ -142,7 +142,7 @@ class UserController extends Controller
$all = $relation->where('category_id', $id)->get();
// $all->setPath('');
/* from whole attribute pick the article_id */
$article_id = $all->lists('article_id');
$article_id = $all->pluck('article_id');
$categorys = $category->get();
/* direct to view with $article_id */
return view('themes.default1.client.kb.article-list.category', compact('all', 'id', 'categorys', 'article_id'));

View File

@@ -34,7 +34,7 @@ class ApiSettings extends Controller
$ticket_detail = '';
$settings = $this->api;
if ($settings->get()->count() > 0) {
$details = $this->api->lists('value', 'key')->toArray();
$details = $this->api->pluck('value', 'key')->toArray();
}
if (array_key_exists('ticket_detail', $details)) {
$ticket_detail = $details['ticket_detail'];

View File

@@ -206,7 +206,7 @@ class PhpMailController extends Controller
public function setServices($emailid, $protocol)
{
$service = new \App\Model\MailJob\FaveoMail();
$services = $service->where('email_id', $emailid)->lists('value', 'key')->toArray();
$services = $service->where('email_id', $emailid)->pluck('value', 'key')->toArray();
$controller = new \App\Http\Controllers\Admin\helpdesk\EmailsController();
$controller->setServiceConfig($protocol, $services);
}
@@ -279,7 +279,7 @@ class PhpMailController extends Controller
if ($active_queue) {
$short = $active_queue->short_name;
$fields = new \App\Model\MailJob\FaveoQueue();
$field = $fields->where('service_id', $active_queue->id)->lists('value', 'key')->toArray();
$field = $fields->where('service_id', $active_queue->id)->pluck('value', 'key')->toArray();
}
$this->setQueueConfig($short, $field);
}

View File

@@ -97,7 +97,7 @@ class TemplateController extends Controller
{
try {
$i = $this->template->orderBy('created_at', 'desc')->first()->id + 1;
$type = $this->type->lists('name', 'id')->toArray();
$type = $this->type->pluck('name', 'id')->toArray();
return view('themes.default1.common.template.create', compact('type'));
} catch (\Exception $ex) {
@@ -135,7 +135,7 @@ class TemplateController extends Controller
try {
$i = $this->template->orderBy('created_at', 'desc')->first()->id + 1;
$template = $this->template->where('id', $id)->first();
$type = $this->type->lists('name', 'id')->toArray();
$type = $this->type->pluck('name', 'id')->toArray();
return view('themes.default1.common.template.edit', compact('type', 'template'));
} catch (\Exception $ex) {