コード例 #1
0
 /**
  * @param Account $account
  * @param Account $moveTo
  *
  * @return boolean
  */
 public function destroy(Account $account, Account $moveTo = null)
 {
     if (!is_null($moveTo)) {
         // update all transactions:
         DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]);
     }
     $account->delete();
     return true;
 }
コード例 #2
0
 /**
  * @param Account $account
  *
  * @return boolean
  */
 public function destroy(Account $account)
 {
     $account->delete();
     return true;
 }