diff --git a/docs/3_installation.md b/docs/3_installation.md index 6e3728b..00a87ed 100644 --- a/docs/3_installation.md +++ b/docs/3_installation.md @@ -60,11 +60,11 @@ Laravel Visits can be configured to act the way you like, `config/visits.php` is #### engine ```php -'engine' => 'redis', +'engine' => \Awssat\Visits\DataEngines\RedisEngine::class, ``` -Suported data engines are `redis`, and `eloquent` currently. -If you use `eloquent` then data will be stored in the default database (MySQL, SQLite or the one you are using) +Suported data engines are `\Awssat\Visits\DataEngines\RedisEngine::class`, and `eloquent` currently. +If you use ` \Awssat\Visits\DataEngines\EloquentEngine::class` then data will be stored in the default database (MySQL, SQLite or the one you are using) #### connection diff --git a/src/Visits.php b/src/Visits.php index e8e7a01..1bafa3c 100755 --- a/src/Visits.php +++ b/src/Visits.php @@ -100,16 +100,7 @@ public function __construct($subject = null, $tag = 'visits') protected function determineConnection($name) { - $connections = [ - 'redis' => \Awssat\Visits\DataEngines\RedisEngine::class, - 'eloquent' => \Awssat\Visits\DataEngines\EloquentEngine::class - ]; - - if(! array_key_exists($name, $connections)) { - throw new \Exception("(Laravel-Visits) The selected engine `{$name}` is not supported! Please correct this issue from config/visits.php."); - } - - return app($connections[$name]); + return app($name); } /** diff --git a/src/config/visits.php b/src/config/visits.php index 2721a9e..dfb9520 100755 --- a/src/config/visits.php +++ b/src/config/visits.php @@ -10,7 +10,7 @@ | Connection Name: see config/database.php | */ - 'engine' => 'redis', + 'engine' => \Awssat\Visits\DataEngines\RedisEngine::class, 'connection' => 'laravel-visits', diff --git a/tests/Feature/EloquentPeriodsTest.php b/tests/Feature/EloquentPeriodsTest.php index cb6cdad..20920b6 100755 --- a/tests/Feature/EloquentPeriodsTest.php +++ b/tests/Feature/EloquentPeriodsTest.php @@ -13,7 +13,7 @@ public function setUp(): void { parent::setUp(); - $this->app['config']['visits.engine'] = 'eloquent'; + $this->app['config']['visits.engine'] = \Awssat\Visits\DataEngines\EloquentEngine::class; $this->connection = app(\Awssat\Visits\DataEngines\EloquentEngine::class) ->setPrefix($this->app['config']['visits.keys_prefix']); include_once __DIR__.'/../../database/migrations/create_visits_table.php.stub'; diff --git a/tests/Feature/EloquentVisitsTest.php b/tests/Feature/EloquentVisitsTest.php index a4a7cfb..708156e 100755 --- a/tests/Feature/EloquentVisitsTest.php +++ b/tests/Feature/EloquentVisitsTest.php @@ -12,7 +12,7 @@ public function setUp(): void { parent::setUp(); - $this->app['config']['visits.engine'] = 'eloquent'; + $this->app['config']['visits.engine'] = \Awssat\Visits\DataEngines\EloquentEngine::class; $this->connection = app(\Awssat\Visits\DataEngines\EloquentEngine::class) ->setPrefix($this->app['config']['visits.keys_prefix']); include_once __DIR__.'/../../database/migrations/create_visits_table.php.stub';