Skip to content

Commit

Permalink
fix: Update translations/filter clause and add image to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dmandrade committed Apr 8, 2022
1 parent d10636d commit 4ed3805
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

# Filament Advanced Filter

![AdvancedFilters](./images/advancedfilters.png)

A collection of easy-to-use filters with clause conditions to [Filament](https://filamentphp.com)

## Installation
Expand Down
Binary file added images/advancedfilters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions resources/lang/en/clauses.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
'not_set' => 'Is not set',
'equal' => 'Is equal to',
'not_equal' => 'Is not equal to',
'greater_equal' => 'Is on or after',
'less_equal' => 'Is on or before',
'on_after' => 'Is on or after',
'on_before' => 'Is on or before',
'greater_equal' => 'Is greater than or equal to',
'less_equal' => 'Is less than or equal to',
'greater_than' => 'Is more than',
'less_than' => 'Is less than',
'between' => 'Is between',
Expand Down
6 changes: 4 additions & 2 deletions resources/lang/pt-BR/clauses.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
'not_set' => 'Não está definido',
'equal' => 'É igual a',
'not_equal' => 'Não é igual a',
'greater_equal' => 'É igual ou depois',
'less_equal' => 'É igual ou antes',
'on_after' => 'É igual ou depois',
'on_before' => 'É igual ou antes',
'greater_equal' => 'É maior ou igual a',
'less_equal' => 'É menor ou igual a',
'greater_than' => 'É mais que',
'less_than' => 'É menos do que',
'between' => 'Está entre',
Expand Down
12 changes: 6 additions & 6 deletions src/Filters/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class DateFilter extends Filter

const CLAUSE_EQUAL = 'equal';
const CLAUSE_NOT_EQUAL = 'not_equal';
const CLAUSE_GREATER_OR_EQUAL = 'greater_equal';
const CLAUSE_LESS_OR_EQUAL = 'less_equal';
const CLAUSE_ON_AFTER = 'on_after';
const CLAUSE_ON_BEFORE = 'on_before';
const CLAUSE_GREATER_THAN = 'greater_than';
const CLAUSE_LESS_THAN = 'less_than';
const CLAUSE_BETWEEN = 'between';
Expand All @@ -29,8 +29,8 @@ protected function clauses(): array
return [
static::CLAUSE_EQUAL => __('filament-advancedfilter::clauses.equal'),
static::CLAUSE_NOT_EQUAL => __('filament-advancedfilter::clauses.not_equal'),
static::CLAUSE_GREATER_OR_EQUAL => __('filament-advancedfilter::clauses.greater_equal'),
static::CLAUSE_LESS_OR_EQUAL => __('filament-advancedfilter::clauses.less_equal'),
static::CLAUSE_ON_AFTER => __('filament-advancedfilter::clauses.on_after'),
static::CLAUSE_ON_BEFORE => __('filament-advancedfilter::clauses.on_before'),
static::CLAUSE_GREATER_THAN => __('filament-advancedfilter::clauses.greater_than'),
static::CLAUSE_LESS_THAN => __('filament-advancedfilter::clauses.less_than'),
static::CLAUSE_BETWEEN => __('filament-advancedfilter::clauses.between'),
Expand All @@ -44,8 +44,8 @@ protected function applyClause(Builder $query, string $column, string $clause, a
$operator = match ($clause) {
static::CLAUSE_EQUAL, static::CLAUSE_NOT_SET => '=',
static::CLAUSE_NOT_EQUAL, static::CLAUSE_SET => '!=',
static::CLAUSE_GREATER_OR_EQUAL => '>=',
static::CLAUSE_LESS_OR_EQUAL => '<=',
static::CLAUSE_ON_AFTER => '>=',
static::CLAUSE_ON_BEFORE => '<=',
static::CLAUSE_GREATER_THAN => '>',
static::CLAUSE_LESS_THAN => '<',
default => $clause
Expand Down

0 comments on commit 4ed3805

Please sign in to comment.