Skip to content

Releases: devaction-labs/filterable-package

v1.0.21

15 Mar 18:09
0326d6d

Choose a tag to compare

Merge pull request #17 from devaction-labs/fix/filter-json

Fix/filter json

🚀 [v1.0.20]

15 Mar 17:07
596642c

Choose a tag to compare

Merge pull request #16 from devaction-labs/feature/readme

docs(README): update package description and features

🚀 [v1.0.19]

15 Mar 16:51
557eb21

Choose a tag to compare

Merge pull request #15 from devaction-labs/roolback

Roolback

🚀 [v1.0.18] - Caching Support and Performance Improvements

14 Mar 15:39
0d942d6

Choose a tag to compare

Merge pull request #14 from devaction-labs/feature/new-feture-cache

chore: update version to v1.0.18 in composer.json

🚀 [v1.0.17] - Caching Support and Performance Improvements

14 Mar 10:53
c106f94

Choose a tag to compare

✨ What's New

  • Added a caching layer to the Filterable trait using CacheManager, significantly improving query performance by caching filter results.
  • Cache keys are generated intelligently based on request parameters and filter criteria, reducing redundant database queries.

⚙️ Features

  • Automatic caching of filter results.
  • Configurable cache behavior (enabled/disabled, TTL, custom prefix).
  • New FilterableServiceProvider with auto-discovery for easier setup.

🔧 Improvements

  • Optimized query performance with caching layer.
  • Cleaner and more maintainable filter logic.

⚠️ Potential Impacts

  • Requires proper cache invalidation to avoid serving stale data after database updates.
  • Increased test complexity due to added caching layer.

📖 Upgrade Guide

Run the following command to publish the configuration file:

php artisan vendor:publish --tag=filterable-config

🚀 Improvement: Caching Implementation for Optimized Performance

14 Mar 10:39
50727cb

Choose a tag to compare

This update introduces caching support to the Filterable package, significantly enhancing query performance by reducing redundant database hits. The core addition, CacheManager, ensures optimal caching by storing results based on unique filter criteria and request parameters. Cached items are intelligently managed using Laravel's built-in cache mechanisms, including tag-based invalidation for simplified cache clearing.

Highlights:

  • ✅ Automatically caches results of frequent filter queries.
  • ✅ Caches are invalidated using Laravel tags (filterable), enabling efficient and isolated clearing of cached data.
  • ✅ Configurable caching behavior (TTL, prefix, and enabling/disabling cache globally via config).

Potential Drawbacks:

  • Requires careful handling to ensure the cache is invalidated after relevant data changes; otherwise, it might serve outdated data.
  • Slightly increases complexity, as tests now must account for caching layers and potential mocking intricacies.

Overall, this enhancement promotes better performance with minimal drawbacks when configured and tested properly.

Compatibilite laravel 12

25 Feb 11:21
98e9541

Choose a tag to compare

Compatibilite laravel 12

Fix for per_page parameter issue when using Laravel Octane

15 Feb 20:40
71109c3

Choose a tag to compare

Description:
This release addresses an issue where the per_page parameter was ignored in the production environment when using Laravel Octane with Swoole. The underlying cause was related to how Request::capture() is cached in memory. The fix involved replacing it with request(), ensuring that pagination works as expected across all requests.

Fix: Proper Handling of BETWEEN Filter in Filterable Package

25 Jan 21:34
875056a

Choose a tag to compare

Pull Request (PR) Description

This PR addresses the issue with the BETWEEN operator in the Filterable Package, ensuring correct SQL queries are generated and executed. The main changes include:

Proper Parsing of BETWEEN Values:
    The setValueFromRequest method now correctly transforms request strings (e.g., "2025-01-17,2025-01-19") into arrays for whereBetween.
    Added validation to ensure the BETWEEN filter value is always an array with exactly two elements.

Dedicated Logic for BETWEEN:
    In the scopeFilterable method, the BETWEEN logic was isolated and implemented with the whereBetween query builder method.
    The use of continue ensures no redundant conditions are applied after BETWEEN.

Enhanced Error Handling:
    Invalid values for BETWEEN now throw clear exceptions (InvalidArgumentException) to assist debugging.

Key Changes

Filter Class:
    Improved setValueFromRequest to parse and validate BETWEEN values properly.
    Added strict checks to ensure BETWEEN receives valid input.

Filterable Trait:
    Isolated BETWEEN logic in scopeFilterable, ensuring it handles whereBetween exclusively.
    Prevented redundant conditions with the use of continue.

## [1.0.12] - Fix: Handle `BETWEEN` Filter for String Input

25 Jan 21:02
296e945

Choose a tag to compare

[1.0.1] - Fix: Handle BETWEEN Filter for String Input

Description:
This release fixes an issue with the BETWEEN filter, ensuring that comma-separated string inputs are correctly parsed into arrays before applying the filter. This improvement resolves exceptions caused by improper value handling.

What's Fixed:

  • BETWEEN Filter Parsing: Values for BETWEEN filters passed as comma-separated strings (e.g., 2025-01-19,2025-01-19) are now correctly parsed into arrays.
  • Improved Validation: Validates the BETWEEN filter value to ensure it is a two-element array and throws meaningful exceptions if invalid.

Example Usage:

API Request:

GET /orders?filter[created_at]=2025-01-19,2025-01-19