Skip to content

Configuration ​

Every setting has a default. Publish the config file only to change one:

bash
php artisan vendor:publish --tag="laravel-schema-viewer-config"
KeyDefaultWhat it does
enabledSCHEMA_VIEWER_ENABLED, unsetUnset: on in local, off elsewhere. true or false decides for every environment.
pathSCHEMA_VIEWER_PATH, schema-viewerThe URL path of the viewer.
domainSCHEMA_VIEWER_DOMAIN, unsetServes the viewer on its own domain.
middleware['web']Route middleware. The viewSchema check is always added.
connectionsnullnull reads the default connection and every connection a model uses. A list reads exactly those, e.g. ['mysql', 'analytics'].
default_connectionSCHEMA_VIEWER_DEFAULT_CONNECTION, allWhat the viewer opens on: all puts every connection on one diagram, or name one, e.g. mysql. An unknown name opens on all. The HTML export keeps it.
editorSCHEMA_VIEWER_EDITOR, nullOpens models and relations in your editor at their line: phpstorm, vscode, cursor, zed, sublime and the other names Laravel's app.editor takes, or ['href' => 'myeditor://open?file={file}&line={line}']. Add 'base_path' when the editor sees the project at another path (Docker, Sail, WSL). null uses app.editor, in local only; without either there are no editor links. Links with unsafe schemes such as javascript: are dropped.
cache.enabledSCHEMA_VIEWER_CACHE, trueKeeps the schema the viewer read until a model file, this config, a connection's migrations or an SQLite database file changes. The refresh button (Shift R) reads it again, e.g. after altering a table by hand. The artisan commands never cache.
cache.storeSCHEMA_VIEWER_CACHE_STORE, nullThe cache store; null uses the default.
cache.ttl3600Seconds before the schema is read again anyway.
modelsnullFolders scanned for models. null scans app/Models.
exclude_tables[]Tables never shown. Wildcards allowed, e.g. telescope_*.
framework_tablesLaravel's own tables, telescope_*, pulse_*Shown and tagged, so one toggle hides them. They get no hints.
package_tablestrueTags the tables of installed packages (Passport, spatie/laravel-permission, Filament Breezy), so one toggle hides them. They still get hints.
hints.ignore[]Rules for the hints you have accepted, such as ['connection' => 'mysql', 'table' => 'audit_logs']; see Ignoring hints.
hints.fail_onforeign_key_without_index, unresolved_relation, model_without_tableKinds that make schema-viewer:check fail.