function generateWorkTickets($pID) { $ticks = ProjectPart::where('in_project', 1)->where('project_id', $pID)->get(); foreach ($ticks as $tick) { Workticket::create(['project_id' => $pID, 'part_id' => $tick->part_listing_id, 'scopestatus_id' => 1]); } // end foreach return $pID; }
public function listOne($id) { //show single $ticket = Workticket::with($this->related)->findOrFail($id); return view('tickets.single', compact('ticket')); }