PHP code example of leonardl00 / metabase

1. Go to this page and download the library: Download leonardl00/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/ */

    

leonardl00 / metabase example snippets


'metabase' => [
    'url' => env('METABASE_URL'),
    'secret' => env('METABASE_SECRET'),
],
blade
<!-- embed dashboard -->
<x-metabase dashboard="1"></x-metabase>

<!-- embed question -->
<x-metabase question="2"></x-metabase>

<!-- passing html attributes -->
<x-metabase question="2" width="80%" height="500px"></x-metabase>

<!-- passing metabase parameters -->
@php($params = ['category' => 'php'])
<x-metabase dashboard="1" :params="$params"></x-metabase> 
// BEWARE of the colon in ":params" (not "param") because we are passing array variable directly to the component
 
<!-- passing additional metabase parameters -->
<x-metabase dashboard="1" :params="$params" :bordered="false" titled theme="night"></x-metabase>