Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samfelgar/metabase-dashboard
https://github.com/samfelgar/metabase-dashboard
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/samfelgar/metabase-dashboard
- Owner: samfelgar
- Created: 2021-12-21T06:05:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-05T05:36:50.000Z (over 1 year ago)
- Last Synced: 2024-10-13T01:12:28.476Z (3 months ago)
- Language: PHP
- Size: 348 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metabase Dashboard
This packages provides a tool for embedding Metabase dashboards in your Laravel Nova application.
## Install
Via Composer
``` bash
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')`.```php
$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.
```php
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).