public function store(InvoiceRequest $request) { $tracking_id = $request->get('tracking_id'); $tracking = Tracking::find($tracking_id); $request['holdback'] = $request->has('holdback') ? true : false; $request['additional'] = $request->has('additional') ? true : false; $tracking->invoices()->save(new Invoice($request->all())); return \Redirect::route('tracking.invoices', $tracking_id)->withMessage('Invoice Added'); }
public function trackingInvoice($id) { return Tracking::with('invoices', 'invoices.taxRates')->find($id); }