/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tickets = Ticket::all();
     // return view('tickets.index', compact('tickets'));
     return view('tickets.index')->with('tickets', $tickets);
     // return view('tickets.index', ['tickets', $tickets];
 }
 public function composeNav()
 {
     view()->composer(['layouts._leftnav', 'layouts._filternav'], function ($view) {
         $view->with('backlogs', Backlog::all('id', 'name'));
         $view->with('open_tickets_count', Ticket::where('status', 'open')->count());
         $view->with('close_tickets_count', Ticket::where('status', 'close')->count());
         $view->with('bug_tickets_count', Ticket::where('type', 'bug')->count());
         $view->with('task_tickets_count', Ticket::where('type', 'task')->count());
         $view->with('high_prio_tickets_count', Ticket::where('priority', 'high')->count());
         $view->with('low_prio_tickets_count', Ticket::where('priority', 'low')->count());
         $view->with('medium_prio_tickets_count', Ticket::where('priority', 'medium')->count());
     });
     view()->composer(['tickets.create', 'tickets.show', 'tickets.edit'], function ($view) {
         $ticket = new Ticket();
         $view->with('ticket_types', $ticket->displayTypes());
         $view->with('ticket_priorities', $ticket->displayPriorities());
         $view->with('backlogs', Backlog::all('id', 'name'));
         $view->with('users', User::all('id', 'name'));
     });
     view()->composer(['user.profile'], function ($view) {
         $view->with('user_all_tickets', Auth::user()->tickets()->paginate(10));
     });
     view()->composer(['tickets.index', 'layouts._leftnav', 'layouts._filternav'], function ($view) {
         $view->with('all_tickets_count', Ticket::all()->count());
     });
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     if (Auth::check()) {
         $tickets = Ticket::all();
         return view('tickets.index', compact('tickets'));
     }
     return redirect('/users/login');
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     if (in_array(Auth::user()->id, [1, 2])) {
         $tickets = Ticket::all();
     } else {
         $tickets = Ticket::where('user_id', Auth::user()->id)->get();
     }
     return view('tickets.index', compact('tickets'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //        $router1 = App::make('router');
     //        $test = 'aaa';
     //        App::instance('router',$test);
     //        $router2 = App::make('router');
     $tickets = Ticket::all();
     return view('tickets.index')->with('tickets', $tickets);
     //            ->with('router1', $router1)
     //            ->with('router2', $router2);
 }
 public function testPhoneNumberValidation()
 {
     // Given
     $this->startSession();
     $invalidPhoneNumber = '5558180';
     // When
     $response = $this->call('POST', route('new-ticket'), ['name' => 'Customer name', 'phone_number' => $invalidPhoneNumber, 'description' => 'I lost my ability to even', '_token' => csrf_token()]);
     // Then
     $flashMessage = $this->app['session']->get('errors')->getBag('default')->get('phone_number');
     $this->assertEquals(['The phone number must be in E.164 format'], $flashMessage);
     $this->assertCount(0, Ticket::all());
 }
 public function home(Content $content, Ticket $ticket, User $user, Application $application, BusinessUnit $businessUnit)
 {
     //FIND USERS WITH SUBMITTED TICKETS
     $users_with_tickets = User::has('tickets')->get();
     //USERS WHO ARE NOT ADMIN
     $non_admin_users = $user->notAdmin()->get();
     $admin_users = $user->admins()->get();
     $tickets_all = $ticket->all()->count();
     $tickets_c = $ticket->completed()->get()->count();
     $prj_brief_records = $content->latest()->brief()->get();
     $prj_notes_records = $content->latest()->notes()->get();
     $status_records = $content->latest()->status()->get();
     $applications = $application->get();
     $users = $user->get();
     return view('pages.home', compact('prj_notes_records', 'status_records', 'tickets_c', 'tickets_all', 'users_with_tickets', 'applications', 'non_admin_users', 'admin_users', 'users'));
 }
Beispiel #8
0
 /**
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function allViewFilter()
 {
     if ($this->filter === 'all') {
         $view = \App\Ticket::all();
     } elseif ($this->filter === 'unassigned') {
         $view = \App\Ticket::where('user_id', null)->get();
     } elseif ($this->filter === 'open') {
         $view = \App\Ticket::where('status', $this->filter)->get();
     } elseif ($this->filter === 'closed') {
         $view = \App\Ticket::where('status', $this->filter)->get();
     } elseif ($this->filter === 'started') {
         $view = \App\Ticket::where('activity', $this->filter)->get();
     } elseif ($this->filter === 'not_started') {
         $view = \App\Ticket::where('activity', $this->filter)->get();
     }
     return $view;
 }
 public function getIndex()
 {
     $tickets = \App\Ticket::all();
     return view('ticket.index', ['tickets' => $tickets]);
 }
 public function index()
 {
     $tickets = Ticket::all();
     return view('tickets.index')->with('tickets', $tickets);
 }
Beispiel #11
0
 public static function cargarUltimoId()
 {
     $conteo = \App\Ticket::all()->count();
     return $conteo + 1;
 }
Beispiel #12
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //Muestra todos los tickets
     $tickets = Ticket::all();
     return view('tickets.index', compact('tickets'));
 }
Beispiel #13
0
 public function index()
 {
     // show all
     $records = Ticket::all();
     return $records;
 }
 public function dashboard()
 {
     $tickets = Ticket::all();
     return view('supportDashboard', ['tickets' => $tickets]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tickets = Ticket::all();
     return $tickets;
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tickets = Ticket::all();
     return view('tickets.index', compact('tickets'));
 }
 public function showTickets()
 {
     $tickets = Ticket::all()->filter(function ($ticket) {
         return Gate::allows('view-ticket', $ticket);
     });
     return view('helpdesk/manyTickets', compact('tickets'));
 }
Beispiel #18
0
 public function getSandbox()
 {
     $tickets = Ticket::all();
     return $tickets;
 }