1. Go to this page and download the library: Download riipandi/php-metabase library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
riipandi / php-metabase example snippets
baseUrl = '[metabase_url]'; // The url of the metabase installation
$metabaseKey = '[metabase_key]'; // The metabase secret embed key
$dashboardId = 1; // The id of the dashboard (from the url)
$params = ['date' => 'past26weeks']; // Any parameters to pass to the dashboard (optional)
$metabase = new \Metabase\Embed($metabaseUrl, $metabaseKey);
// Generate the HTML to create an iframe with the embedded dashboard
echo $metabase->dashboardIframe($dashboardId, $params);
$metabaseUrl = config('metabase.url'); // The url of the metabase installation
$metabaseKey = config('metabase.key'); // The metabase secret embed key
$dashboardId = 1; // The id of the dashboard (from the url)
$params = ['date' => 'past26weeks']; // Any parameters to pass to the dashboard (optional)
$metabase = new \Metabase\Embed($metabaseUrl, $metabaseKey);
// Generate the HTML to create an iframe with the embedded dashboard
echo $metabase->dashboardIframe($dashboardId, $params);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.