webbingbrasil / filament-advancedfilter Goto Github PK
View Code? Open in Web Editor NEWA collection of easy-to-use filters with clause conditions to Filament
License: MIT License
A collection of easy-to-use filters with clause conditions to Filament
License: MIT License
To have some filters in the comon dropdown and some filters above the table. Filament only allow all filters in the dropdown or above the table.
Technical difficulty | User goals | Usage frequency |
---|---|---|
Medium | More customizable layout | Daily |
This current package offers great filters. This feature request is about the layout (where the filters will be inserted) so it might be something new for this package (maybe it requires to extend Filament\Tables\Table
).
I want to change the form:
Problem is that the clauses
and fields
are protected methods so unable to do this.
Would you be open to a PR to make these public?
DateFilter::make('created_at')
->form(function(DateFilter $filter): array {
return [
Group::make()
->schema(array_merge([
Select::make('clause')
->label($filter->getLabel())
->options($filter->clauses()),
], $filter->fields()))
];
})
Describe the bug
In Filament v3 getRelationshipTitleColumnName
has been replaced with getRelationshipTitleAttribute
IN src/Concerns/HasClauses.php ::apply function this needs to be change.
Right now relationship is not working on filters.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Filter should work with relationship.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
I have a table column that displays counts of related records and I'd like to be able to filter the table for a minimum or maximum value of that count.
To Reproduce
I'm using a TextColumn with the ->counts('') method to generate the number I'd like to sort
Expected behavior
I tried using the ->relationship() method but didn't see a way to get it to work.
If there IS a supported way to do this, maybe it would be good to add it as an example in the readme? I'd think it might be pretty common.
Thank you!
Describe the bug
When attempting to use a NumberFilter, setting the value to "0" result in the filter not being applied.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The column should be filtered
Additional context
Current workaround is to input "-0" instead of 0, which isn't "friendly" to my end users.
This appears to happen because empty(0)
evaluates to true
.
Maintain Semantic Versioning for the package
Technical difficulty | User goals | Usage frequency |
---|---|---|
small | Updating the package with composer | Daily |
This will be useful for those who already using this great package !
Describe the bug
The error Undefined array key ""
when we select the option "Select an option" from the matcher type dropdown once another option is selected.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No error should appear.
Hi @dmandrade, thank you very much for this useful package. You are doing a good job.
I'm having trouble with my BooleanFilter tests. It was working before I used filament-advancedfilter
.
I wrote my tests as described in the filament documentation.
it('can filtering was done with is_active in the customers table.', function () {
$customers = Customer::factory(10)->create();
livewire(ListCustomers::class)
->assertCanSeeTableRecords($customers)
->filterTable('is_active')
->assertCanSeeTableRecords($customers->where('is_active', true))
->assertCanNotSeeTableRecords($customers->where('is_active', false));
});
The assertion assertCanNotNotSeeTableRecords($customers->where('is_active', false))
is currently failing when this test was running before.
The code I configured the filter is very simple. It is as follows.
BooleanFilter::make('is_active')
wire:model
has tableFilters.is_active.clause
. Can adding .clause
cause this problem? Do you have a solution for this?
Laravel: v10.0.5
Filament: v2.17.23
Filament AdvancedFilter: v1.2.1
protected function applyClause(Builder $query, string $column, string $clause, array $data = []): Builder
need to change
fn (Builder $query) => $query->where($column, $operator, (int)$data['value'])
Adding AND/OR Button under the filter to generate another filter form to apply for the same table column
Technical difficulty | User goals | Usage frequency |
---|---|---|
Large | Creating More advanced Data Table Filters | Daily |
This is an enhancement for the project
Also if you can point me in right direction giving me some tips , I will happy to do a PR for this. I really appreciate your hard work for this package !
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.