murdercode/nova4-bitbucket-news-commits
A Laravel Nova 4 card that surfaces Bitbucket news and recent commits right inside your admin panel, so teams get an at-a-glance view of repository activity without switching tools. Lightweight, easy to install, and simple to configure for your workspace.
This is a pre-1.0 package (v0.0.2), so treat the public API as provisional. The core idea is a "card" that renders data sourced from a repository, and the v0.0.2 release makes the card reusable: you can invoke it multiple times on the same page, each invocation bound to a different repository.
Minimal steps:
php artisan vendor:publish --tag=...). Check the package's service provider for what is registered and what is publishable.First use case: a dashboard where the same card layout is rendered against two data sources — e.g. an "open tickets" card backed by an internal repository and the same card backed by an external/API repository. Before v0.0.2 you effectively had to duplicate the card; now you pass a different repository per call.
Look first at: the service provider, the repository interface, and the card's constructor/signature. The signature is where the v0.0.2 change is most visible and is the best indicator of how per-instance configuration is intended to work.
One card, many repositories. The headline pattern is invoking the card repeatedly with distinct repositories:
<x-card :repository="$internalTickets" />
<x-card :repository="$externalTickets" />
or, if the card is resolved from the container:
app(Card::class, ['repository' => $internalTickets]);
app(Card::class, ['repository' => $externalTickets]);
Confirm from the source whether the repository is passed via constructor, a fluent setter, a config key, or a Blade attribute — v0.0.x packages often support one and not the others.
Repository as a thin adapter. Keep repositories focused on fetching/normalising data for the card. Put caching, pagination, and authorisation in the repository, not the card, so each card instance inherits the behaviour of its own data source.
Per-instance configuration. When rendering multiple cards, push variation into the repository rather than the card. If the card accepts options (title, limit, filters), pass them per invocation; if it doesn't yet, wrap the card in your own Blade component that supplies defaults.
Composition over duplication. Build a small wrapper component for each card variant in your app (e.g. <x-ticket-card>) that resolves the right repository and forwards attributes. This insulates your views from the package's pre-1.0 API churn.
Integration tips. Bind repositories in a dedicated service provider rather than inline in views. If the package supports config-driven repositories, prefer config for static wiring and container bindings for anything requiring runtime dependencies (HTTP clients, current tenant, authenticated user).
Testing. Instantiate the card with a fake/in-memory repository in feature tests and assert rendered output per repository. Test the multi-invocation case explicitly — that is the behaviour v0.0.2 introduced and the most likely place for regressions.
bind, not singleton) unless the repository is genuinely stateless.composer.json and read the diff before upgrading; v0.0.2 is a feature addition, not a documented breaking change, but treat minor bumps as potentially breaking.@once guards or package-level deduplication if you see duplicated output.dd($card->repository::class) or equivalent). Most "wrong data" bugs are a binding or resolution problem, not a rendering problem.php artisan config:cache after changes, and avoid closures in config files if the package reads them at boot.How can I help you explore Laravel packages today?