PHP code example of edrisranjbar / filament-product-analytics

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

    

edrisranjbar / filament-product-analytics example snippets


use EdrisRanjbar\FilamentProductAnalytics\FilamentProductAnalyticsPlugin;

public function panel(\Filament\Panel $panel): \Filament\Panel
{
    return $panel->plugin(FilamentProductAnalyticsPlugin::make());
}

use App\Models\User;
use Illuminate\Support\Facades\Gate;

Gate::define('viewProductAnalytics', function (User $user): bool {
    return $user->is_admin; // Replace with your app's existing authorization rule.
});

analytics('dashboard.viewed');
analytics()->track('invoice.paid', ['amount' => 9900, 'plan' => 'pro']);
analytics()->for($user)->tenant($team)->track('report.exported', ['format' => 'pdf']);
bash
composer vendor:publish --tag=product-analytics-migrations
php artisan migrate
bash
php artisan queue:work --queue=analytics