public function commit(ConnectionInterface $connection)
    {
        // We decrement the transaction level and prevent events to be dispatched
        // while comitting nested transactions, so no transient state is saved.
        // Only dispatch events right after the outer transaction commits.
        $this->transactionLevel--;
        if (! $this->isPrepared($connection) || $this->transactionLevel > 0) {
            return;
        }

        $this->dispatchPendingEvents($connection);
    }
public function commit(ConnectionInterface $connection)
    {
        // We decrement the transaction level and prevent events to be dispatched
        // while comitting nested transactions, so no transient state is saved.
        // Only dispatch events right after the outer transaction commits.
        $this->transactionLevel--;
        if (! $this->isPrepared($connection) || $this->transactionLevel > 0) {
            return;
        }

        $this->dispatchPendingEvents($connection);
    }
public function commit ( ConnectionInterface $ connection ) { // We decrement the transaction level and prevent events to be dispatched // while comitting nested transactions, so no transient state is saved. // Only dispatch events right after the outer transaction commits. $ this -> transactionLevel -- ; if ( ! $ this -> isPrepared ( $ connection ) || $ this -> transactionLevel > 0 ) { return ; } $ this -> dispatchPendingEvents ( $ connection ) ; }
Flush all pending events.

@param  \Illuminate\Database\ConnectionInterface  $connection
@return void
Flush all pending events .