/** * TicketRepository constructor. */ public function __construct(Ticket $ticket, TicketAnswer $ticketAnswer, TicketCategory $category) { $this->model = $ticket; $this->ticketAnswer = $ticketAnswer; $this->category = $category; $this->userId = \Auth::id(); $this->ansTable = $ticketAnswer->getTable(); $this->tckTable = $ticket->getTable(); $this->catTable = $category->getTable(); }
public function show($id) { $tickets = $this->ticketRepo->show($id); $root = $tickets['root']; $children = $tickets['children']; $categories = TicketCategory::all(); $categories = array_pluck($categories, 'name', 'id'); return view('irticket::show', compact('root', 'children', 'categories')); }