Butterfly
Butterfly
FFilament
Created by Butterfly on 4/2/2024 in #❓┊help
Policy not applying on custom action
If it's possible, I would also like to know how the prebuilt actions are able to automatically detect them
3 replies
FFilament
Created by Butterfly on 3/11/2024 in #❓┊help
Passing props to a custom column
that worked! really appreciate the help 😄
10 replies
FFilament
Created by Anish on 3/4/2024 in #❓┊help
DateConstraint
The example follows the one provided in the docs: https://filamentphp.com/docs/3.x/tables/filters/custom In order to use the JS-based date picker I believe you can add ->native(false) to the DatePickers
5 replies
FFilament
Created by Anish on 3/4/2024 in #❓┊help
DateConstraint
I believe that you are trying to achieve something like this:
Filter::make('application_submitted_at')
->form([
DatePicker::make('from'),
DatePicker::make('until'),
])->query(function (Builder $query, array $data): Builder {
return $query
->when(
$data['from'],
fn (Builder $query, $date): Builder => $query->whereDate('application_submitted_at', '>=', $date),
)
->when(
$data['until'],
fn (Builder $query, $date): Builder => $query->whereDate('application_submitted_at', '<=', $date),
);
});
Filter::make('application_submitted_at')
->form([
DatePicker::make('from'),
DatePicker::make('until'),
])->query(function (Builder $query, array $data): Builder {
return $query
->when(
$data['from'],
fn (Builder $query, $date): Builder => $query->whereDate('application_submitted_at', '>=', $date),
)
->when(
$data['until'],
fn (Builder $query, $date): Builder => $query->whereDate('application_submitted_at', '<=', $date),
);
});
5 replies