User story
As a user, I want a global search bar in the company panel so I can quickly find invoices, quotes, clients, and products by number or name without navigating to each module individually.
Scope
Searchable resources
| Resource |
Searchable fields |
| Invoices |
invoice_number, customer company_name |
| Quotes |
quote_number, prospect company_name |
| Clients (Relations) |
company_name, relation_number, trading_name |
| Products |
product_name |
Acceptance criteria
Implementation notes
Filament v4 global search is enabled per resource by implementing getGloballySearchableAttributes():
// InvoiceResource.php
public static function getGloballySearchableAttributes(): array
{
return ['invoice_number', 'customer.company_name'];
}
Each resource that should appear in global search results must implement this method. The panel provider enables global search by default via the top bar.
Arrange · Act · Assert
#[Test]
public function it_finds_an_invoice_via_table_search(): void
{
/* Arrange */
Invoice::factory()->for($this->company)->create(['invoice_number' => 'INV-SEARCH-001']);
/* Act */
$component = Livewire::actingAs($this->user)
->test(ListInvoices::class, ['tenant' => Str::lower($this->company->search_code)])
->searchTable('INV-SEARCH-001');
/* Assert */
$component->assertSuccessful();
$component->assertCountTableRecords(1);
}
Split from #512, which had an incorrect title ("add search bar") on a body that described date field auto-population. This is the search bar issue; #512 now tracks date field auto-population.
User story
As a user, I want a global search bar in the company panel so I can quickly find invoices, quotes, clients, and products by number or name without navigating to each module individually.
Scope
Searchable resources
invoice_number, customercompany_namequote_number, prospectcompany_namecompany_name,relation_number,trading_nameproduct_nameAcceptance criteria
Implementation notes
Filament v4 global search is enabled per resource by implementing
getGloballySearchableAttributes():Each resource that should appear in global search results must implement this method. The panel provider enables global search by default via the top bar.
Arrange · Act · Assert
Split from #512, which had an incorrect title ("add search bar") on a body that described date field auto-population. This is the search bar issue; #512 now tracks date field auto-population.