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()); }); }
/** * Saves a backlog, to be invoked via ajax * * @param Request $request * @return JSON */ public function store(Request $request) { $this->validate($request, ['title' => 'required', 'project_id' => 'required']); $backlog = Backlog::create($request->all()); $backlog->load('user'); $backlog = $backlog->toArray(); if (is_null($backlog['user'])) { $backlog['user']['name'] = ''; } return $backlog; }
/** * Returns the Tickets for a given Backlog ID * * @param $id * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function tickets_by_backlog($id) { $tickets = Ticket::where('backlog_id', $id)->latest()->paginate(10); $header = 'Tickets for Backlog ' . Backlog::findOrFail($id)->name; return view('tickets.index', compact('tickets', 'header')); }
/** * Returns the Tickets for a given Backlog id * * @param $id * @return View */ public function tickets_by_backlog($id) { $tickets = $this->ticket->whereBacklogId($id)->orderBy('id', 'asc')->paginate(10); $header = 'Tickets for Backlog ' . Backlog::findOrFail($id)->name; return view('tickets.index', compact('tickets', 'header')); }
public function show(Request $request, Backlog $backlog, $sprint) { $backlog->load('sprint.comments'); return view('backlogs_sprints.show', compact('backlog')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(Project $project, Backlog $backlog) { $backlog->delete(); return response()->json(['status' => 'success', 'message' => 'Backlog deleted.']); }