LaravelPackages.net
Acme Inc.
Toggle sidebar
samfelgar/metabase-dashboard

Laravel Nova tool for embedding Metabase dashboards

4.200
1
2.0.0
About samfelgar/metabase-dashboard

samfelgar/metabase-dashboard is a Laravel package for laravel nova tool for embedding metabase dashboards. It currently has 1 GitHub stars and 4.200 downloads on Packagist (latest version 2.0.0). Install it with composer require samfelgar/metabase-dashboard. Discover more Laravel packages by samfelgar or browse all Laravel packages to compare alternatives.

Last updated

Metabase Dashboard

This packages provides a tool for embedding Metabase dashboards in your Laravel Nova application.

Install

Via Composer

composer require samfelgar/metabase-dashboard

Usage

First, you'll need a Samfelgar\MetabaseDashboard\DataTransferObjects\Dashboard instance. It receives four parameters: url, secret, resource and params.

PRO TIP: It's not advisable to keep secrets in your codebase. You can create a config file pointing to an environment variable and access it with config('your-config-file.secret').

$dashboard = new \Samfelgar\MetabaseDashboard\DataTransferObjects\Dashboard(
    'https://example.com',
    'your-secret',
    1, // resource id
    [
    'param' => 'value'
    ]
);

Then, on your App\Providers\NovaServiceProvider, you can register the tool:

IMPORTANT: You must pass a unique identifier as the first parameter, or else you may experience some weird behavior.

public function tools(): array
{
    return [
        (new \Samfelgar\MetabaseDashboard\MetabaseDashboard('uniqueIdentifier', $dashboard))
            ->label('Awesome Label')
            ->title('Awesome Title'),
    ];
}

TIP: You can instantiate more than one dashboard, just be sure to define a unique identifier for each of them.

Contributing

All contributions are welcome! Please open a PR.

Security

If you discover any security related issues, please email [email protected] or open an issue.

License

The MIT License (MIT).

Comments