Skip to content

Commit

Permalink
Update README & SeoScan
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed May 30, 2023
1 parent 2095312 commit 5ac93ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ When you want to save the SEO score to the database, you need to set the `save`
Optionally you can specify the database connection in the config file. If you want to save the SEO score to a model, you need to add the model to the `models` array in the config file. More information about this can be found in the [Check the SEO score of a model](#check-the-seo-score-of-a-model) section.

#### Pruning the database
Per default the package will prune the database from old scans. You can disable this by setting the `prune` option to `false` in the config file. If you want to prune the database, you can specify the number of days you want to keep the scans in the database. The default is 30 days.
Per default the package will prune the database from old scans. You can specify the number of days you want to keep the scans in the database. The default is 30 days.

If you want to prune the database, you need to add the prune command to your `App\Console\Kernel`:

Expand Down
6 changes: 1 addition & 5 deletions src/Models/SeoScan.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ public function scores(): HasMany
return $this->hasMany(SeoScore::class);
}

public function prunable(): ?Builder
public function prunable(): Builder
{
if (! config('seo.database.prune.older_than_days')) {
return null;
}

return static::where('created_at', '<=', now()->subDays(config('seo.database.prune.older_than_days')));
}
}

0 comments on commit 5ac93ba

Please sign in to comment.