PHP code example of jeffersongoncalves / laravel-simple-analytics

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

    

jeffersongoncalves / laravel-simple-analytics example snippets


$settings = simple_analytics_settings();
$settings->enabled = true;
$settings->hostname = 'example.com';
$settings->save();

use JeffersonGoncalves\SimpleAnalytics\Facades\SimpleAnalytics;
use JeffersonGoncalves\SimpleAnalytics\Settings\SimpleAnalyticsSettings;

$settings = app(SimpleAnalyticsSettings::class);
$value = SimpleAnalytics::getFacadeRoot()->enabled;
bash
php artisan vendor:publish --tag=simple-analytics-settings-migrations
php artisan migrate