Configuration
Publish the config file if you haven’t already:
php artisan vendor:publish --tag=scoutify-configdebounce_ms
Section titled “debounce_ms”Wait time in milliseconds before firing a search after the user stops typing.
'debounce_ms' => 250,recents
Section titled “recents”Persists the last few searches to the user’s session.
'recents' => [ 'enabled' => true, 'limit' => 5, 'storage' => 'session',],discovery
Section titled “discovery”Paths where Scoutify scans for Eloquent models using the Searchable trait.
'discovery' => [ 'paths' => [ app_path('Models'), ],],'modal' => [ 'breakpoint_desktop' => 'md', // Tailwind breakpoint for desktop layout],authorization
Section titled “authorization”Default visibility behaviour for searchable models.
'authorization' => [ 'default' => 'secure', // 'secure' | 'permissive' | 'gate-only' 'gate_ability' => 'view',],secure(default): guests denied; authenticated users passGate::check('view')if a policy exists, otherwise allowed.permissive: everyone allowed.gate-only: everyone (including guests, if the gate closure allows) must pass the gate check; fails closed if no policy is found.
broadcast_events
Section titled “broadcast_events”Browser event names dispatched by the modal. Override to avoid conflicts with other libraries.
'broadcast_events' => [ 'open' => 'scoutify:open', 'opened' => 'scoutify:opened', 'closed' => 'scoutify:closed', 'remember' => 'scoutify:remember',],preview
Section titled “preview”File preview feature configuration. See File Preview for full details.
'preview' => [ 'enabled' => true, 'route_prefix' => 'scoutify/preview', 'middleware' => ['web'], 'ttl_seconds' => 300, 'max_size_bytes' => 50 * 1024 * 1024, 'allowed_mimes' => [ /* ... */ ], 'viewer_for_mime' => [ /* ... */ ], 'fallback_view' => 'scoutify::components.gs.preview.viewer-fallback',],Fluent API (types, theme, UI)
Section titled “Fluent API (types, theme, UI)”Type registration, icon prefix, CSS class overrides, custom color tokens, and UI visibility flags are configured in PHP — not in this file:
use Matheusmarnt\Scoutify\Facades\Scoutify;use Matheusmarnt\Scoutify\Support\UiConfig;
// In AppServiceProvider::boot()Scoutify::types() ->iconPrefix('heroicon-o-') ->register(\App\Models\User::class, label: 'Users', icon: 'user', color: 'indigo');
Scoutify::theme() ->dialogPanel('relative bg-white dark:bg-zinc-900 ...');
Scoutify::configureUi(fn (UiConfig $ui) => $ui->showHintBar(false));See the v2 upgrade guide for a full reference of all fluent methods.