Add updated_at filter

This commit is contained in:
David Bomba 2023-02-10 09:25:26 +11:00
parent 38141754d1
commit 1bae14c337

View File

@ -232,6 +232,28 @@ abstract class QueryFilters
} }
public function updated_at($value = '')
{
if ($value == '')
return $this->builder;
try {
if (is_numeric($value)) {
$created_at = Carbon::createFromTimestamp((int)$value);
} else {
$created_at = Carbon::parse($value);
}
return $this->builder->where('updated_at', '>=', $created_at);
} catch (\Exception $e) {
return $this->builder;
}
}
public function is_deleted($value) public function is_deleted($value)
{ {
if ($value == 'true') { if ($value == 'true') {