Internals
Filter Operations
Filter operations are used to apply specific conditions to the data being queried. They help in narrowing down the results based on various criteria. Filter operations are registered in the config/visualizations.php file under the filters key. Each filter operation class must implement the FilterOperationContract interface.
Configuration
The filter operations are configured in the config/visualizations.php file:
php
<?php
return [
'filters' => [
// Equality
Equals::class,
DoesNotEqual::class,
// In
In::class,
NotIn::class,
// Numeric
GreaterThan::class,
GreaterThanOrEqualTo::class,
LessThan::class,
LessThanOrEqualTo::class,
// String
Contains::class,
DoesNotContain::class,
EndsWith::class,
StartsWith::class,
],
];This configuration ensures that the specified filters are available for use in the application. Each filter class defines the conditions it can handle and the logic to apply those conditions to the query.
Available Filter Operations
Equality
| Filter Operation | Description |
|---|---|
| Equals | Checks if a value is equal to the specified value. |
| DoesNotEqual | Checks if a value is not equal to the specified value. |
Strings
| Filter Operation | Description |
|---|---|
| Contains | Checks if a string contains the specified substring. |
| DoesNotContain | Checks if a string does not contain the specified substring. |
| EndsWith | Checks if a string ends with the specified substring. |
| StartsWith | Checks if a string starts with the specified substring. |
Numeric
| Filter Operation | Description |
|---|---|
| GreaterThan | Checks if a value is greater than the specified value. |
| GreaterThanOrEqualTo | Checks if a value is greater than or equal to the specified value. |
| LessThan | Checks if a value is less than the specified value. |
| LessThanOrEqualTo | Checks if a value is less than or equal to the specified value. |
Sets
| Filter Operation | Description |
|---|---|
| In | Checks if a value is within a specified set of values. |
| NotIn | Checks if a value is not within a specified set of values. |