PHPackages                             winex01/backpack-filter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. winex01/backpack-filter

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

winex01/backpack-filter
=======================

Laravel backpack free filter without buying pro version.

2.1.2(1y ago)38991[1 issues](https://github.com/winex01/backpack-filter/issues)MITPHP

Since Aug 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/winex01/backpack-filter)[ Packagist](https://packagist.org/packages/winex01/backpack-filter)[ Docs](https://github.com/winex01/backpack-filter)[ RSS](/packages/winex01-backpack-filter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (25)Used By (0)

BackpackFilter
==============

[](#backpackfilter)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1f1eb4102a9b712f00267081afa1338b0a6db77d37db13363f4ed8311e365652/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77696e657830312f6261636b7061636b2d66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/winex01/backpack-filter)[![Total Downloads](https://camo.githubusercontent.com/b47d9ee5a98851a57afeb1d8c8e9d139debae25db38d05058230ffcf910ed0aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77696e657830312f6261636b7061636b2d66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/winex01/backpack-filter)[![The Whole Fruit Manifesto](https://camo.githubusercontent.com/9fc65ecdd629dc33c369f73e0bc051740f01647367c131a574577fea2a5678bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f77726974696e672532307374616e646172642d74686525323077686f6c6525323066727569742d627269676874677265656e)](https://github.com/the-whole-fruit/manifesto)

This package provides a filter functionality for [Backpack for Laravel](https://backpackforlaravel.com/) administration panel. If you don't have the budget or haven't purchased the pro version, this is a great alternative for implementing filters.

Screenshots
-----------

[](#screenshots)

[![bootstrap5](https://private-user-images.githubusercontent.com/23657442/354599365-537cd5a5-85f1-4bb7-b790-7de7de330d70.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MjQzMzIsIm5iZiI6MTc3NTUyNDAzMiwicGF0aCI6Ii8yMzY1NzQ0Mi8zNTQ1OTkzNjUtNTM3Y2Q1YTUtODVmMS00YmI3LWI3OTAtN2RlN2RlMzMwZDcwLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA3VDAxMDcxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVhNGRlZDVlZGZlYWMxYzE3NmQ4NzUzZDRjYmUxYTQ3NjdlYTQ2ZWFkYzFhNjIwZTJhNDIyMjQwNGI5YmRlM2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.GHUu4gzjr96CV_4wduzws1tTjgqNoclRMPaczUtbkps)](https://private-user-images.githubusercontent.com/23657442/354599365-537cd5a5-85f1-4bb7-b790-7de7de330d70.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MjQzMzIsIm5iZiI6MTc3NTUyNDAzMiwicGF0aCI6Ii8y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mM4MDZiODg4MzM0NmM4ODllYjkwNTI3MmMwZjkyNzUwYWRjZGFkMmE5ZTVhOWM2OTRlYmE1OTZkNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._eEx_4EBGB7bqUiGHKDDolwbC3X21U-n03_9HXT39ek)](https://private-user-images.githubusercontent.com/23657442/353813369-b411481d-6ccf-47aa-828a-79e7f2e17b01.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MjQzMzIsIm5iZiI6MTc3NTUyNDAzMiwicGF0aCI6Ii8yMzY1NzQ0Mi8zNTM4MTMzNjktYjQxMTQ4MWQtNmNjZi00N2FhLTgyOGEtNzllN2YyZTE3YjAxLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA3VDAxMDcxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0ZmQxZmM4MDZiODg4MzM0NmM4ODllYjkwNTI3MmMwZjkyNzUwYWRjZGFkMmE5ZTVhOWM2OTRlYmE1OTZkNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._eEx_4EBGB7bqUiGHKDDolwbC3X21U-n03_9HXT39ek)

Theme Supported
---------------

[](#theme-supported)

- theme-coreuiv2 - YES
- theme-coreuiv4 - YES
- theme-tabler - YES

Supported Fields
----------------

[](#supported-fields)

- Free Backpack Fields
- date\_range (this is custom so it has limited customization, can change wrapper and attributes)

Installation
------------

[](#installation)

Via Composer

```
composer require winex01/backpack-filter
```

Usage: inside your EntityCrudController do:
-------------------------------------------

[](#usage-inside-your-entitycrudcontroller-do)

```
class EntityCrudController extends CrudController
{
    use \Winex01\BackpackFilter\Http\Controllers\Operations\FilterOperation;

    public function setup()
    {
        CRUD::setModel(\App\Models\SampleModel::class);
        CRUD::setRoute(config('backpack.base.route_prefix') . '/sample');
        CRUD::setEntityNameStrings('sample', 'samples');

        $this->crud->allowAccess('filters'); // Allow access
    }

    public function setupFilterOperation()
    {
        $this->crud->field([
            'name' => 'status',
            'label' => __('Status'),
            'type' => 'select_from_array',
            'options' => [
                1 => 'Connected',
                2 => 'Disconnected'
            ],
            'wrapper' => [
                'class' => 'form-group col-md-6'
            ]
        ]);

        //
        $this->crud->field([
            'name' => 'date_range',
            'label' => __('Date Range'),
            'type' => 'date_range',
            // although this is a custom field, you can still use the wrapper and attribute here
        ]);
    }
```

To apply the filter field into queries, inside your setupListOperation:

```
public function setupListOperation()
{
    // if you use this method closure, validation is automatically applied.
    $this->filterQueries(function ($query) {
        $status = request()->input('status');
        $dates = request()->input('date_range');

        if ($status) {
            $query->where('status_id', $status);
        }

        if ($dates) {
            $dates = explode('-', $dates);
            //$query->where... your clause here or scope.
        }
    });

    //CRUD::setFromDb();
    CRUD::setFromDb(false, true); //by doing this, it will remove all those fields that was automatically added by backpack

    // or dont use CRUD::setFromDb(false, true) and just manually add columns each
    $this->crud->columns('testColumn');
    // more columns etc...
}
```

Filter validation automatically applied but if you want to make your own validation:

```
public function filterValidations()
{
    // If no access to filters, then don't proceed but don't show an error.
    if (!$this->crud->hasAccess('filters')) {
        return false;
    }

    // if you dont want to use validator and want to use request file, modify below, up to you.

    $validationErrors = [];

    // validator here.

    if (!empty($validationErrors)) {
        \Alert::error($validationErrors)->flash();
        return redirect()->back();
    }

    return redirect()->back()->withInput(request()->input());
}
```

This package also provides with export using , this operation automatically add entity/export route, be sure you have EntityExport.php file in your export directory. example if you have UserCrudController, you must have app/Exports/UserExport.php file. Also if you have an active filters it will also apply into the export.

```
// crud controller
class UserCrudController extends CrudController
{
    use \Winex01\BackpackFilter\Http\Controllers\Operations\ExportOperation;

    // Optional: if you dont want to use the entity/export or user/export convention you can override the export route:
    public function exportRoute()
    {
        return route('test.export');; // if you define a route here then it will use instead of the auto
    }

    // setup method...
}
```

Publish config
--------------

[](#publish-config)

```
php artisan vendor:publish --provider="Winex01\BackpackFilter\BackpackFilterServiceProvider" --tag="config"
```

Change log
----------

[](#change-log)

Changes are documented here on Github. Please see the [Releases tab](https://github.com/winex01/backpack-filter/releases).

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for a todolist and howtos.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Winnie A. Damayo](https://github.com/winex01)
- [All Contributors](../../contributors)

License
-------

[](#license)

This project was released under MIT, so you can install it on top of any Backpack &amp; Laravel project. Please see the [license file](license.md) for more information.

However, please note that you do need Backpack installed, so you need to also abide by its [YUMMY License](https://github.com/Laravel-Backpack/CRUD/blob/master/LICENSE.md). That means in production you'll need a Backpack license code. You can get a free one for non-commercial use (or a paid one for commercial use) on [backpackforlaravel.com](https://backpackforlaravel.com).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Recently: every ~32 days

Total

23

Last Release

413d ago

Major Versions

1.1.8 → 2.0.02024-10-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9a819d29bb757978dd236043435782683f31fc4f24baffedca9c0866dccfefe?d=identicon)[winex01](/maintainers/winex01)

---

Top Contributors

[![winex01](https://avatars.githubusercontent.com/u/23657442?v=4)](https://github.com/winex01 "winex01 (69 commits)")

---

Tags

laravelbackpackBackpack for LaravelBackpack AddonBackpack FilterBackpack Free Filter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/winex01-backpack-filter/health.svg)

```
[![Health](https://phpackages.com/badges/winex01-backpack-filter/health.svg)](https://phpackages.com/packages/winex01-backpack-filter)
```

###  Alternatives

[backpack/theme-tabler

UI for Backpack v6 that uses Tabler and Bootstrap v5.

35536.5k](/packages/backpack-theme-tabler)[backpack/activity-log

Activity Log for Backpack

3487.5k1](/packages/backpack-activity-log)[backpack/translation-manager

Translation Manager for Backpack

5118.9k1](/packages/backpack-translation-manager)[backpack/medialibrary-uploaders

Helper functions to save files with spatie media library

1373.3k](/packages/backpack-medialibrary-uploaders)[thomascombe/backpack-async-export

This is a package to manage async export in Backpack for Laravel

1528.5k](/packages/thomascombe-backpack-async-export)[figlabhq/crud-resource-for-backpack

Build CRUD panels using fluent field definitions.

122.1k](/packages/figlabhq-crud-resource-for-backpack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
