Skip to content

Configuration

Publish the config file if you haven’t already:

Terminal window
php artisan vendor:publish --tag=scoutify-config

Wait time in milliseconds before firing a search after the user stops typing.

'debounce_ms' => 250,

Persists the last few searches to the user’s session.

'recents' => [
'enabled' => true,
'limit' => 5,
'storage' => 'session',
],

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
],

Default visibility behaviour for searchable models.

'authorization' => [
'default' => 'secure', // 'secure' | 'permissive' | 'gate-only'
'gate_ability' => 'view',
],
  • secure (default): guests denied; authenticated users pass Gate::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.

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',
],

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',
],

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.