Filtering submissions
The submissions tab of a form has a column per field, hidden until someone
turns it on, except for the fields an editor marks "Show as a column"
(->showColumn() in code). A field's "Column name" (->columnLabel('Hours'))
is its short name there and wherever answers are listed apart from the form:
the export, the filters, the merge tags and the mails. The detail page keeps
the question.
The tab filters by rules such as "Name contains jan" or
"Hours is at least 32", combined with and and or. Every field offers the rules
that suit its type: text matches whatever its case, a number compares as a
number, a choice goes by its options, a checkbox by whether it was ticked and
an upload by whether there is a file. The page a submission came from and its
campaign's utm_source, utm_medium and utm_campaign have text rules too.
The inverse of a rule, such as "does not contain", also matches the
submissions that left the field empty. The list of all submissions only
filters by form.
Groups joined by or need Livewire to accept state 13 levels deep, where it
stops at 10 by default; until then the filter offers rules joined by and only.
Raise the limit in config/livewire.php (php artisan livewire:publish --config
if the app has none yet):
'payload' => [
// ...
'max_nesting_depth' => 13,
],A field type of your own offers its rules in getFilterConstraints(). By
default every column it fills gets the text rules:
use VanOns\FilamentFormBuilder\Filament\Tables\Filters\AnswerConstraints;
public function getFilterConstraints(): array
{
return [AnswerConstraints::choice($this->getKey(), $this->getColumnLabel(), Branch::options())];
}