Skip to content

Instantly share code, notes, and snippets.

@agm1984
Created Jul 10, 2020
Embed
What would you like to do?
Example of how to use the `DatabaseTransactions` Trait in Laravel.
<?php
namespace Tests;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication, DatabaseTransactions;
// your other stuff hence-forth
}
@agm1984
Copy link
Author

agm1984 commented Jul 10, 2020

This file exists alongside this sampler pack: https://gist.github.com/agm1984/7332c324165a020daa6ce6b91a437635

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment