<?php

namespace App\Filters;

class LogFilter extends Filters
{
    protected function module($value)
    {
        return $this->builder->where('module', '=', $value);
    }

    protected function action($value)
    {
        return $this->builder->where('action', '=', $value);
    }

    protected function targetType($value)
    {
        return $this->builder->where('target_type', '=', $value);
    }

    protected function targetId($value)
    {
        return $this->builder->where('target_id', '=', $value);
    }

    protected function targetField($value)
    {
        return $this->builder->where('target_field', '=', $value);
    }

    protected function userId($value)
    {
        return $this->builder->where('user_id', '=', $value);
    }

    protected function startTime($value)
    {
        return $this->builder->where('created_at', '>=', $value);
    }

    protected function endTime($value)
    {
        return $this->builder->where('created_at', '<=', $value);
    }
}
