/** * Update order * * @param Order $order * @param array $data * @throws \SaleBoss\Repositories\Exceptions\InvalidArgumentException * @return mixed */ public function update(Order $order, array $data = []) { try { $order->update($data); return $order; } catch (QueryException $e) { throw new InvalidArgumentException($e->getMessage()); } }
public function findLastLogFor(Order $order) { return $order->orderLogs()->with('changer')->orderBy('created_at', 'DESC')->first(); }