Skip to content

Upgrading to v2.0

Scoutify v2.0 replaces config-file UI customization with a fluent PHP API. This is a hard breaking change — any removed config key still present in config/scoutify.php will throw a RuntimeException on boot, pointing back to this page.

The following config/scoutify.php keys no longer exist:

Removed keyReplacement
icon_prefixScoutify::types()->iconPrefix()
typesScoutify::types()->register()
classesScoutify::theme()->…()
colorsScoutify::theme()->color()
modal.uiScoutify::configureUi()

Config keys that remain unchanged: debounce_ms, recents, discovery, preview, modal.breakpoint_desktop, authorization, broadcast_events.

Composer’s caret (^1.x) blocks major-version upgrades — v2 will never be installed until you change the constraint. Edit composer.json manually:

"matheusmarnt/scoutify": "^2.1"

Before running composer update, remove the legacy keys from config/scoutify.php. The safest approach is to delete the file entirely — you will re-publish it at step 4:

Terminal window
rm config/scoutify.php

If you have customized keys that survive into v2 (debounce_ms, recents, discovery, preview, modal.breakpoint_desktop, authorization, broadcast_events), manually remove only the legacy keys (icon_prefix, types, classes, colors, modal.ui) instead of deleting the file.

Terminal window
composer update matheusmarnt/scoutify -W
Terminal window
php artisan vendor:publish --tag=scoutify-config --force

Move any values you removed in step 2 to AppServiceProvider::boot() using the fluent API. See the sections below.


Before:

config/scoutify.php
'types' => [
\App\Models\User::class => ['label' => 'Users', 'icon' => 'heroicon-o-user', 'color' => 'indigo'],
\App\Models\Post::class => ['label' => 'Posts', 'icon' => 'heroicon-o-document-text', 'color' => 'blue'],
],

After — call in boot() of App\Providers\AppServiceProvider (or any service provider):

use Matheusmarnt\Scoutify\Facades\Scoutify;
public function boot(): void
{
Scoutify::types()
->register(\App\Models\User::class, label: 'Users', icon: 'heroicon-o-user', color: 'indigo')
->register(\App\Models\Post::class, label: 'Posts', icon: 'heroicon-o-document-text', color: 'blue');
}

register() accepts the same fields (label, icon, color) as the old array format.

Before:

config/scoutify.php
'icon_prefix' => 'ri-',

After:

use Matheusmarnt\Scoutify\Facades\Scoutify;
public function boot(): void
{
Scoutify::types()->iconPrefix('ri-');
}

Before:

config/scoutify.php
'classes' => [
'dialog_panel' => 'relative bg-white dark:bg-zinc-900 ...',
'dialog_scrim' => 'fixed inset-0 ...',
'input' => 'w-full ...',
'trigger' => 'flex items-center ...',
'toggle_active' => 'bg-blue-100 text-blue-700 ...',
'toggle_inactive' => 'text-gray-500 ...',
],

After:

use Matheusmarnt\Scoutify\Facades\Scoutify;
public function boot(): void
{
Scoutify::theme()
->dialogPanel('relative bg-white dark:bg-zinc-900 ...')
->dialogScrim('fixed inset-0 ...')
->input('w-full ...')
->trigger('flex items-center ...')
->toggleActive('bg-blue-100 text-blue-700 ...')
->toggleInactive('text-gray-500 ...');
}

Before:

config/scoutify.php
'colors' => [
'brand' => ['light' => 'bg-blue-100 text-blue-700', 'dark' => 'dark:bg-blue-900/60 dark:text-blue-200'],
],

After:

Scoutify::theme()->color('brand', 'bg-blue-100 text-blue-700', 'dark:bg-blue-900/60 dark:text-blue-200');

Before:

config/scoutify.php
'modal' => [
'ui' => [
'show_type_chips' => false,
'show_hint_bar' => false,
],
],

After:

use Matheusmarnt\Scoutify\Facades\Scoutify;
use Matheusmarnt\Scoutify\Support\UiConfig;
public function boot(): void
{
Scoutify::configureUi(function (UiConfig $ui) {
$ui->showTypeChips(false)
->showHintBar(false);
});
}

Available UiConfig flags:

MethodDefaultDescription
showTypeChips(bool)trueToggle the model-type filter chips
showToggleOnlyActive(bool)trueToggle the “Active only” toggle
showToggleIncludeTrashed(bool)trueToggle the “Include trashed” toggle
showHintBar(bool)trueToggle the keyboard-shortcut hint bar
showIdleHint(bool)trueToggle the idle-state hint
<?php
namespace App\Providers;
use App\Models\Post;
use App\Models\User;
use Illuminate\Support\ServiceProvider;
use Matheusmarnt\Scoutify\Facades\Scoutify;
use Matheusmarnt\Scoutify\Support\UiConfig;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Scoutify::types()
->iconPrefix('heroicon-o-')
->register(User::class, label: 'Users', icon: 'user', color: 'indigo')
->register(Post::class, label: 'Posts', icon: 'document-text', color: 'blue');
Scoutify::theme()
->dialogPanel('relative bg-white dark:bg-zinc-900 rounded-xl shadow-2xl ring-1 ring-black/5');
Scoutify::configureUi(function (UiConfig $ui) {
$ui->showHintBar(false);
});
}
}

If you added custom colors via Scoutify::theme()->color(), add their classes to your Tailwind source so they are included in the CSS build:

resources/css/app.css
@source inline("bg-brand-100 text-brand-700 dark:bg-brand-900/60 dark:text-brand-200");