diff --git a/composer.json b/composer.json index c95e7d0..886f4ee 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "require": {}, "require-dev": { "phpunit/phpunit": "~4.0", - "phpunit/dbunit": "^2.0" + "phpunit/dbunit": "^2.0", + "illuminate/database": "^5.1" }, "autoload": { "psr-4": { diff --git a/src/InsertOnDuplicateKey.php b/src/InsertOnDuplicateKey.php index 0ffba4d..d29c44c 100644 --- a/src/InsertOnDuplicateKey.php +++ b/src/InsertOnDuplicateKey.php @@ -93,9 +93,9 @@ public static function replace(array $data) */ public static function getTableName() { - $class = static::class; + $class = get_called_class(); - return $class::getTable(); + return (new $class())->getTable(); } /** @@ -105,9 +105,9 @@ public static function getTableName() */ public static function getModelConnectionName() { - $class = static::class; + $class = get_called_class(); - return $class::getConnection(); + return (new $class())->getConnection(); } /**