> ## Documentation Index
> Fetch the complete documentation index at: https://flex-theme.bjanczak.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Use the resources, pages and policies already registered in your Filament panel.

These examples assume FLEX Theme is installed and its theme assets are configured in your panel.

## Enable the default search

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
use Filament\Panel;
use Flex\Theme\FlexThemePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->globalSearch()
        ->plugin(FlexThemePlugin::make());
}
```

Search is enabled by default in the plugin. `FlexThemePlugin::make()->search()` explicitly selects that same default configuration. Enable or disable it in PHP; Theme Settings contains search preferences, not an activation switch.

## Make a resource searchable

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
use Illuminate\Database\Eloquent\Model;

// In your CustomerResource:
protected static ?string $recordTitleAttribute = 'name';

public static function getGloballySearchableAttributes(): array
{
    return ['name', 'email'];
}

public static function getGlobalSearchResultDetails(Model $record): array
{
    return ['Email' => $record->email];
}
```

Register the resource with the panel as usual. Its native global-search eligibility and policies still apply. The theme does not make an unregistered resource available automatically.

## Add explicit configuration

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
use Flex\Theme\Search\SearchConfiguration;

FlexThemePlugin::make()->search(
    SearchConfiguration::make()
        ->placeholder('Search your workspace…')
        ->settings([
            'search_page_size' => 25,
            'search_pagination' => 'infinite',
            'search_virtualization' => true,
        ])
);
```

Values passed through `SearchConfiguration::settings()` are validated and locked in the corresponding Theme Settings controls. Omit a value when administrators should be able to change it.

## Open search from your own button

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<button type="button" x-on:click="$dispatch('flex-search-open')">
    Search workspace
</button>
```

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
window.dispatchEvent(new CustomEvent('flex-search-open', {
    detail: { query: 'Olivia' },
}));
```

The event also accepts a registered `source` ID. Use a custom source's stable ID or `NativeResourceSource::make(CustomerResource::class)->id()` rather than hardcoding the internal resource hash.

## Restore native Filament search

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
FlexThemePlugin::make()->search(false);
```

This disables the FLEX replacement. To disable native search as well, configure the panel with `->globalSearch(false)`. If you want FLEX commands without a native provider, see [Commands](https://flex-theme.bjanczak.com/docs/global-search/commands.md).

Next: [resources](https://flex-theme.bjanczak.com/docs/global-search/resources.md), [actions](https://flex-theme.bjanczak.com/docs/global-search/actions.md), or the complete [settings reference](https://flex-theme.bjanczak.com/docs/global-search/configuration.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.