swisnl/laravel-nova-mirror
swisnl/laravel-nova-mirror provides a Laravel Nova Mirror field that displays another field’s value as read-only on forms and index views. It keeps Nova screens consistent without duplicating data or writing custom resolvers, making it easy to surface derived or related values.
composer require --dev swisnl/laravel-nova-mirror
config/nova-mirror.php:
php artisan vendor:publish --provider="SwisNL\NovaMirror\NovaMirrorServiceProvider"
Read every key before running anything — the config holds your Nova credentials, the target git remote, the working/clone path, and the branch/tag settings..env (e.g. NOVA_MIRROR_REPOSITORY, NOVA_MIRROR_TOKEN). Never commit these..env only.php artisan list | grep -i nova (it is typically nova:mirror):
php artisan nova:mirror
Inspect the resulting commit(s), the branch name, and whether releases are tagged. That one run tells you more about the config than the README does.git log shows the Nova release contents. Then wire it into the scheduler (below) and switch one project's composer.json to consume Nova from your mirror instead of nova.laravel.com.app/Console/Kernel.php and run it nightly. Git must be installed, SSH keys/known_hosts configured, and the host must be the only place this runs:
$schedule->command('nova:mirror')
->dailyAt('03:00')
->withoutOverlapping()
->onOneServer();
composer install on a throwaway runner, executes php artisan nova:mirror, and pushes. This avoids maintaining a long-lived server whose git/SSH setup you have to keep patched.composer require laravel/nova:
"repositories": [
{ "type": "vcs", "url": "[email protected]:acme/nova-mirror.git" }
]
If the mirror is private, add its credentials to COMPOSER_AUTH / auth.json in CI too — Composer needs to authenticate to the mirror just as it did to nova.laravel.com.^1.0, ~1.2) only work if releases are tagged. If the package doesn't tag for you, wrap the command in your own artisan command that runs the mirror, reads the Nova version from the release, and git tags it before pushing. This is the single most valuable extension: untagged mirrors force every consumer to pin a commit hash.repositories entry away.git log as the audit trail. Because each release is a commit, git log --oneline is your changelog and git diff <tag1>..<tag2> is your upgrade review. This is the real reason teams adopt the mirror: it turns a black-box commercial dependency into a reviewable, diffable history you can gate deploys on.composer.json, fork it into your org if you need to maintain the endpoint logic, and treat your fork as own code..env locally and CI secrets in the pipeline. Double-check the published config for any hard-coded defaults before committing it.Contents: read & write on the mirror repo; classic tokens and deploy keys need to bypass branch protection if you push to a protected branch. A 403 on push with valid credentials is almost always scope or branch-protection.composer install in every project pays for it. Keep history lean: consider one mirror repo per major version, periodically squash old history, or use a Composer artifact repository instead of VCS.composer clearcache and re-run composer update laravel/nova; otherwise you'll debug a "stale version" that isn't stale at all.withoutOverlapping() on the scheduler and a CI concurrency group both protect against this.php artisan nova:mirror -v, then cd into the configured working/clone path and run the git commands manually. Most failures are environmental — wrong remote URL, missing SSH agent, known_hosts not populated on a fresh runner, or git not installed on the cron box. Tail storage/logs/laravel.log for the HTTP/exception detail the command swallows.How can I help you explore Laravel packages today?