Update
Keep your Kompass installation current. Update the Composer package, then run the built-in kompass:update command, which republishes assets, runs migrations, and clears caches for you.
Don't run the installer to update
php artisan kompass:install is for first-time setup only — it can offer to drop all your tables for a fresh install. To update an existing project, use kompass:update instead.
Overview
A Kompass update is two steps:
- Update the package with Composer.
- Run
php artisan kompass:update— it republishes assets, runs migrations, clears caches, and can rebuild your frontend.
Always back up first
Before updating in production, back up your database and have a tested rollback (a tagged commit or deployment snapshot). Migrations can change your schema.
Step 1: Update the Package
Pull the latest release within the version constraint in your composer.json:
composer update secondnetwork/kompassTo move to a new major version, bump the constraint first, then update — for example:
composer require secondnetwork/kompass:^1.8Step 2: Run the Updater
php artisan kompass:updateThis runs the whole post-update routine for you:
- Republishes vendor assets — it removes
public/vendor/kompassand force-publishes the new version's assets and migrations, so nothing stale is left behind. - Runs migrations — copies the latest seeders into
database/seedersand runsphp artisan migrate. - Clears caches — runs
php artisan optimize:clearso cached menus, config, routes, and views are rebuilt. - Optionally rebuilds the frontend — it asks whether to rebuild and, if you say yes, which package manager to use (
bun,yarn,npm, orpnpm), then runs the build for you.
The command is interactive
kompass:update prompts you about the frontend rebuild, so run it from a terminal. For non-interactive environments (CI/CD), use the manual steps below instead.
Manual Update (CI / Non-Interactive)
If you can't run the interactive command — for example in a deploy pipeline — run the equivalent steps yourself:
composer update secondnetwork/kompass
php artisan vendor:publish --tag=kompass.assets --force
php artisan migrate
php artisan optimize:clear
npm run build # only if you use the frontend build pipelineAutomate asset publishing
Add the publish command to the post-update-cmd hook in your composer.json so assets refresh automatically after every composer update:
"scripts": {
"post-update-cmd": [
"@php artisan vendor:publish --tag=kompass.assets --force"
]
}This is also recommended during installation.
Review Config and Changelog
A few things are intentionally left under your control and may need a manual look after a major update:
- Config —
config/kompass.phpis published once and is never force-overwritten, so your settings are preserved. After a major update, compare it against the package'sconfig/kompass.phpand merge any new keys you want. - Stubs — published files like
app/Models/User.phpare yours; review the package stubs after a major version bump if the upgrade notes mention changes. - Changelog — check the Changelog for new features, deprecations, and any breaking changes before deploying.