callbackApplicableTransactions()->count() === 0) { return $callback(); } $this->pendingTransactions->last()->addCallback($callback); } /** * Get the transactions that are applicable to callbacks. * * @return \Illuminate\Support\Collection */ public function callbackApplicableTransactions() { return $this->pendingTransactions->skip(1)->values(); } /** * Determine if after commit callbacks should be executed for the given transaction level. * * @param int $level * @return bool */ public function afterCommitCallbacksShouldBeExecuted($level) { return $level === 1; } }