/** * Tickets for a given type * * @param $type * @return View */ public function tickets_by_type($type) { $tickets = $this->ticket->whereType($type)->orderBy('id', 'asc')->paginate(10); $header = $type . ' tickets'; return view('tickets.index', compact('tickets', 'header')); }