<?php

namespace Illuminate\Foundation\Testing;

trait DatabaseTransactions
{
    public function beginDatabaseTransaction()
    {
        $this->app->make('db')->beginTransaction();

        $this->beforeApplicationDestroyed(function () {
            $this->app->make('db')->rollBack();
        });
    }
}
