コード例 #1
0
ファイル: OrderRepository.php プロジェクト: Ajaxman/SaleBoss
 /**
  * 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());
     }
 }
コード例 #2
0
 public function findLastLogFor(Order $order)
 {
     return $order->orderLogs()->with('changer')->orderBy('created_at', 'DESC')->first();
 }