diff --git a/docs/3_installation.md b/docs/3_installation.md index 00a87ed..128da7b 100644 --- a/docs/3_installation.md +++ b/docs/3_installation.md @@ -63,8 +63,8 @@ Laravel Visits can be configured to act the way you like, `config/visits.php` is 'engine' => \Awssat\Visits\DataEngines\RedisEngine::class, ``` -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) +Suported data engines are `\Awssat\Visits\DataEngines\RedisEngine::class`, and `\Awssat\Visits\DataEngines\EloquentEngine::class` 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/docs/4_quick-start.md b/docs/4_quick-start.md index 23f914d..2bd708f 100644 --- a/docs/4_quick-start.md +++ b/docs/4_quick-start.md @@ -50,7 +50,7 @@ $post->vzt()->count(); ## Relationship with models (only for Eloquent engine) -If you are using visits with eloquent as engine (from config/visits.php; engine => 'eloquent') then you can add a relationship method to your models. +If you are using visits with eloquent as engine (from config/visits.php; engine => \Awssat\Visits\DataEngines\EloquentEngine::class) then you can add a relationship method to your models. ```php class Post extends Model diff --git a/src/Commands/CleanCommand.php b/src/Commands/CleanCommand.php index 35ac875..63cd45e 100644 --- a/src/Commands/CleanCommand.php +++ b/src/Commands/CleanCommand.php @@ -4,6 +4,7 @@ use Awssat\Visits\Models\Visit; use Illuminate\Console\Command; +use Awssat\Visits\DataEngines\EloquentEngine; class CleanCommand extends Command { @@ -20,7 +21,7 @@ public function handle() { $currentEngine = config('visits.engine') ?? ''; - if($currentEngine == 'eloquent') { + if($currentEngine == EloquentEngine::class || is_subclass_of($currentEngine, EloquentEngine::class)) { $this->cleanEloquent(); } } diff --git a/src/config/visits.php b/src/config/visits.php index dfb9520..46640a9 100755 --- a/src/config/visits.php +++ b/src/config/visits.php @@ -6,7 +6,7 @@ | Database Engine & Connection Name |-------------------------------------------------------------------------- | - | Supported Engines: "redis", "eloquent" + | Supported Engines: \Awssat\Visits\DataEngines\RedisEngine::class, \Awssat\Visits\DataEngines\EloquentEngine::class | Connection Name: see config/database.php | */