PHP code example of mmhk / laravel-ga-embed

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

    

mmhk / laravel-ga-embed example snippets



return [
     'providers' => [
        //...
         MMHK\GA\GoogleAnalyticsEmbedServiceProvider::class,
     ],
     
     'aliases' => [
        //...
        'GAEmbed' => MMHK\GA\GAEmbed::class,
     ],
];


return [
    'config-file' => base_path('resources/key.json'), //此为 Google API Console中下载的json文件
];

<?= GAEmbed::render($view_id); 
bash
php artisan vendor:publish --provider="MMHK\GA\GoogleAnalyticsEmbedServiceProvider"