agog/osmose
Osmose is a Laravel package for elegantly filtering Eloquent queries via dedicated filter classes. Generate filters with an artisan command, define rules in a residue() array, and apply them with sieve() using built-in direct, callback, and relationship drivers.
bound() method for admin-only queries) to ensure compliance or security constraints.created_at ranges) for time-sensitive data.role=god), direct columns (e.g., gender=male), or custom callbacks./products?category=electronics&price_min=50).bound() rules (e.g., column:tenant_id,123).Adopt Osmose if:
where clauses).bound() rules for admin-only data access).Look Elsewhere if:
For Executives: *"Osmose is a plug-and-play solution to standardize and accelerate filtering across our Laravel backend. By adopting this package, we can:
where clauses).For Engineers: *"Osmose provides a clean, Laravel-native way to handle Eloquent filtering with three key benefits:
php artisan osmose:make-filter.column:id), relationship filters (relationship:roles,name), and custom callbacks for edge cases.osmose(FilterClass::class) to auto-load models, reducing boilerplate in controllers.
Example use case: Replace 20 lines of where clauses in a controller with a single filter class. Also supports date ranges and mandatory filters (bound()) for security/compliance.
Trade-offs: Slight learning curve for the filter driver syntax, but docs and artisan commands make it intuitive."*How can I help you explore Laravel packages today?