instance() public static method

create instance if not exists
public static instance ( ) : TransactionHandler
return TransactionHandler
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     DynamicModel::clearBootedModels();
     $this->app->singleton('xe.db.proxy', function ($app) {
         return ProxyManager::instance($app['xe.register']);
     });
     $this->app->singleton(['xe.db' => DatabaseHandler::class], function ($app) {
         $coupler = DatabaseCoupler::instance($app['db'], TransactionHandler::instance(), $app['xe.db.proxy'], new LaravelCache($app['cache']->driver('schema')));
         $proxyClass = $app['xe.interception']->proxy(DatabaseHandler::class, 'XeDB');
         return new $proxyClass($coupler, $app['config']->get('xe.database'));
     });
 }
 /**
  * set up
  *
  * @return void
  */
 public function setUp()
 {
     $transaction = TransactionHandler::instance();
     $this->transaction = $transaction;
 }