Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dashboard Bundle Laravel Package

kunstmaan/dashboard-bundle

Dashboard bundle for the Kunstmaan CMS on Symfony, adding a configurable admin dashboard with analytics, statistics and widget blocks that surface key site metrics at a glance. Small and low-activity; intended for existing Kunstmaan projects rather than standalone use.

View on GitHub
Deep Wiki
Context7

Getting Started

This bundle is a legacy Symfony 2 / Kunstmaan CMS extension, so start by confirming your stack actually matches before wiring anything up. Check the composer.json constraints, then install it alongside a compatible kunstmaan/admin-bundle / kunstmaan/node-bundle:

composer require kunstmaan/dashboard-bundle

Register the bundle in app/AppKernel.php:

new Kunstmaan\DashboardBundle\KunstmaanDashboardBundle(),

Import its routing under the admin prefix:

# app/config/routing.yml
kunstmaan_dashboard:
    resource: "@KunstmaanDashboardBundle/Resources/config/routing.yml"
    prefix: /admin

Then configure the Google Analytics credentials under kunstmaan_dashboard in config.yml (client id, client secret, redirect URI, and any developer key required by the version you install).

Where to look first:

  1. DependencyInjection/Configuration.php — the authoritative list of config keys and defaults.
  2. Resources/config/services.yml — service ids, widget tags, and the GA service wiring.
  3. Controller/DashboardController.php — how widgets are collected and rendered.
  4. Widget/ — the widget contract (AbstractWidget / WidgetInterface) and built-in GA widgets.
  5. Resources/views/ — template names and override paths.

First use case: get the Google Analytics dashboard rendering at /admin/dashboard. Create a Google Cloud project, enable the Analytics API, create an OAuth client with the redirect URI matching your admin host, put the credentials in config, then load the dashboard and complete the OAuth handshake. Once data appears, add a custom widget for your own KPI.

Implementation Patterns

Custom widgets as tagged services. The bundle discovers widgets through a service tag, not through filesystem scanning. Create a class extending the bundle's abstract widget (confirm the exact contract in Widget/), expose a name and template, then tag it:

namespace Acme\AdminBundle\Widget;

use Kunstmaan\DashboardBundle\Widget\AbstractWidget;

class SalesWidget extends AbstractWidget
{
    public function getName()
    {
        return 'sales';
    }

    public function getTemplate()
    {
        return 'AcmeAdminBundle:Widgets:sales.html.twig';
    }

    public function getData()
    {
        // return array passed to the template
    }
}
# services.yml
acme.dashboard.widget.sales:
    class: Acme\AdminBundle\Widget\SalesWidget
    arguments: ['@doctrine.orm.entity_manager']
    tags:
        - { name: kunstmaan_dashboard.widget, alias: sales }

Keep widget data retrieval out of the template. The built-in GA widgets follow a pattern of querying a service, normalizing the result, and handing a plain array to Twig. Mirror that: inject the GA service (or your repository) into the widget, do the date-range math in PHP, and keep the template dumb. This makes the widget testable and lets you swap the data source later.

Reuse the GA service directly. You do not have to render through the dashboard to benefit from the integration. Inject the bundle's analytics service into your own controllers or commands, request a metric/dimension set for a date range, and render it wherever you need. This is the most durable way to use the package: treat it as a GA client with a dashboard UI attached.

Warm the cache with a command. GA API calls are slow and rate-limited. If the bundle exposes a fetch/refresh command (bin/console list kunstmaan:dashboard to confirm), schedule it via cron and have widgets read from cache/DB rather than calling Google on every admin page load. If no such command exists, write your own console command that calls the same service and persists the result.

Override templates via the standard Symfony path. Copy the original from Resources/views/ into app/Resources/KunstmaanDashboardBundle/views/ and edit there. Do not modify the vendor directory.

Integrate with the admin menu by adding your dashboard route to the Kunstmaan admin menu configuration rather than hard-linking; this keeps permissions and active-state handling consistent with the rest of the CMS.

Gotchas and Tips

  • This is effectively abandoned. Last release was July 2014, with 4 stars and no dependents. Expect PHP 5.x-era code, Symfony 2.3–2.8 constraints, and no compatibility with Symfony 3+. Run composer why-not before assuming it will install.
  • The GA integration targets Universal Analytics (v3), not GA4. Google shut down the Universal Analytics reporting API for most properties. The bundled widgets will return errors or empty data against a GA4 property. Plan to rewrite the data layer against the GA4 Data API if this is for production.
  • OAuth redirect URI mismatches are the most common setup failure. The URI registered in Google Cloud must exactly match the one in config, including scheme, host, port, and trailing slash. Also verify the OAuth consent screen is configured and the Analytics API (not just the OAuth API) is enabled.
  • Token refresh is silent until it isn't. Stored access tokens expire; if refresh fails you get empty widgets rather than an exception. Add logging around the GA client and check the token record when dashboards go blank.
  • Widgets not appearing usually means a tagging problem. Verify with bin/console debug:container --tag=kunstmaan_dashboard.widget. Common causes: service not public, missing alias, or the compiler pass not registered because the bundle was added after cache warmup.
  • Template resolution is convention-based. A wrong getTemplate() string often surfaces as a Twig loader error deep in the dashboard render, not at the widget. Double-check bundle notation (AcmeAdminBundle:Widgets:file.html.twig) versus the newer @AcmeAdmin/... syntax; this bundle predates the latter.
  • Date ranges and timezones drift. GA returns data in the property's timezone while your PHP date math is likely UTC. Off-by-one-day results are usually this, not a caching bug.
  • Clear cache after config or service changes, and clear any dashboard/GA result cache separately if the bundle stores snapshots in the database.
  • Debugging path: check app/logs/ first, then the Symfony profiler for the dashboard request, then debug:container for the widget and GA services. If the dashboard route 404s, the routing import is missing or the prefix conflicts with another admin route.
  • Extension points, in order of safety: override templates; add tagged widgets; decorate the GA service; subclass the dashboard controller last. Avoid editing vendor code, since there will be no upstream fixes.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource