Skip to content

Commit

Permalink
Add compatibility with Laravel 9+
Browse files Browse the repository at this point in the history
Due to an (issue)[laravel/framework#35380], in laravel 9 it fails. This resolves it also make it continue to work on Laravel 6.
  • Loading branch information
a-h-abid authored Dec 6, 2022
1 parent 7561eb2 commit 0ac3992
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/RefreshModuleDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use AHAbid\LaravelRefreshModuleDatabase\States\RefreshModulesDatabaseState;
use AHAbid\LaravelRefreshModuleDatabase\States\RefreshRootDatabaseState;
use App\Console\Kernel;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\RefreshDatabaseState;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -96,6 +97,12 @@ protected function refreshTestDatabase()
}

$this->beginDatabaseTransaction();

try {
if (!$this->app->make('db.transactions')->getTransactions()->isEmpty()) {
DB::commit();
}
} catch (BindingResolutionException $e) {}
}

/**
Expand Down

0 comments on commit 0ac3992

Please sign in to comment.