<?php


namespace ModulesGarden\HostingQuotaNotifications\App\Libs\Cron;


use ModulesGarden\HostingQuotaNotifications\Core\Models\Logger\Model;

class Logs
{
    /**
     * @var
     */
    protected $model;

    public function __construct()
    {
        $this->model = new Model();
    }

    public function deleteOlderThan($days)
    {
        $this->model->whereRaw('date <= DATE_SUB(NOW(), INTERVAL ' . $days . ' DAY)')
                    ->delete();
    }
}