Skip to content

Commit

Permalink
Merge pull request #94 from remxcode/master
Browse files Browse the repository at this point in the history
update 'eloquent' to \Awssat\Visits\DataEngines\EloquentEngine::class
  • Loading branch information
BSN4 authored Jul 30, 2023
2 parents a334b15 + 690899a commit 03a5c7c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/3_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/4_quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/CleanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Awssat\Visits\Models\Visit;
use Illuminate\Console\Command;
use Awssat\Visits\DataEngines\EloquentEngine;

class CleanCommand extends Command
{
Expand All @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/visits.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
*/
Expand Down

0 comments on commit 03a5c7c

Please sign in to comment.