Skip to content

Releases: KalimeroMK/filterable

Refactor

27 Nov 19:17
Compare
Choose a tag to compare

Simplified Condition Logic: Replaced the when() method with a simple if-else condition. This makes the logic more straightforward and easier to read.
Return Statement: Ensured that the macro method explicitly returns $this to maintain the fluid interface of the query builder.
Removed Redundant Closure: The second closure passed to when() in the original code was not necessary because the alternative case can be handled directly in the else block of the if-else statement.

Optimize the code fix psr-4 standard

17 Jun 06:45
Compare
Choose a tag to compare
  • The logic for applying field filters has been moved to a separate method, applyFieldFilter(). This helps in improving readability and separation of concerns.
  • By extracting the field filtering logic into its own method, the main scopeFilter() method becomes more focused and easier to understand.
  • The $query parameter is now passed as a reference to the applyFieldFilter() method to allow direct modification of the query builder instance.
  • The is_numeric($value) condition check for like fields has been removed, as it seems unnecessary.
  • The trait's methods and properties are assumed to be used in a model class that extends Illuminate\Database\Eloquent\Model. Make sure to import the necessary classes and define the properties such as boolFields and likeFields within the model class that uses this trait.

v1.4

28 Feb 09:28
Compare
Choose a tag to compare

Remove publish method for traits

v1.3

26 Feb 10:23
Compare
Choose a tag to compare

Code refactor PSR12

Refactored version of the code

19 Feb 21:13
Compare
Choose a tag to compare

Changes made:

The parameter type and name of the method have been updated to match Laravel's conventions for scope methods.
$this->fillable has been changed to $this->getFillable() to make sure it always returns the correct value, even if the fillable property is modified later on.
The conditions inside the loop have been simplified to avoid unnecessary continue statements and duplicate checks.
The method now returns the modified query builder instance instead of always returning the input query builder.

Code reformat to PSR12

Add whereLike macro

30 Jul 09:10
Compare
Choose a tag to compare

Add whereLike macro in boot method to searche useing where like try database rows and relations

Stable

21 Apr 09:11
cfcf37f
Compare
Choose a tag to compare

In Laravel, we commonly face the problem of adding repetitive filtering code, this package will address this problem