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.
What changed
Section titled “What changed”The following config/scoutify.php keys no longer exist:
| Removed key | Replacement |
|---|---|
icon_prefix | Scoutify::types()->iconPrefix() |
types | Scoutify::types()->register() |
classes | Scoutify::theme()->…() |
colors | Scoutify::theme()->color() |
modal.ui | Scoutify::configureUi() |
Config keys that remain unchanged: debounce_ms, recents, discovery, preview, modal.breakpoint_desktop, authorization, broadcast_events.
Upgrade sequence
Section titled “Upgrade sequence”1. Bump the version constraint
Section titled “1. Bump the version constraint”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"2. Remove legacy config keys
Section titled “2. Remove legacy config keys”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:
rm config/scoutify.phpIf 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.
3. Run composer update
Section titled “3. Run composer update”composer update matheusmarnt/scoutify -W4. Re-publish config
Section titled “4. Re-publish config”php artisan vendor:publish --tag=scoutify-config --force5. Migrate customizations
Section titled “5. Migrate customizations”Move any values you removed in step 2 to AppServiceProvider::boot() using the fluent API. See the sections below.
Migrating customizations
Section titled “Migrating customizations”Move types to a service provider
Section titled “Move types to a service provider”Before:
'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.
Move icon_prefix
Section titled “Move icon_prefix”Before:
'icon_prefix' => 'ri-',After:
use Matheusmarnt\Scoutify\Facades\Scoutify;
public function boot(): void{ Scoutify::types()->iconPrefix('ri-');}Move classes
Section titled “Move classes”Before:
'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 ...');}Move colors (custom color tokens)
Section titled “Move colors (custom color tokens)”Before:
'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');Move modal.ui visibility flags
Section titled “Move modal.ui visibility flags”Before:
'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:
| Method | Default | Description |
|---|---|---|
showTypeChips(bool) | true | Toggle the model-type filter chips |
showToggleOnlyActive(bool) | true | Toggle the “Active only” toggle |
showToggleIncludeTrashed(bool) | true | Toggle the “Include trashed” toggle |
showHintBar(bool) | true | Toggle the keyboard-shortcut hint bar |
showIdleHint(bool) | true | Toggle the idle-state hint |
Complete example
Section titled “Complete example”<?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); }); }}Tailwind safelist
Section titled “Tailwind safelist”If you added custom colors via Scoutify::theme()->color(), add their classes to your Tailwind source so they are included in the CSS build:
@source inline("bg-brand-100 text-brand-700 dark:bg-brand-900/60 dark:text-brand-200");