PHP code example of solution-forest / filament-goaccess

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

    

solution-forest / filament-goaccess example snippets


use SolutionForest\FilamentGoAccess\GoAccessPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(GoAccessPlugin::make());
}

   'mode' => 'managed',

   'sites' => [
       'default' => [
           'label'     => 'My site',
           'log_paths' => ['/var/log/nginx/access.log'],
           'json_path' => storage_path('app/goaccess/default.json'),
           'db_path'   => storage_path('app/goaccess/default-db'),
           'log_format'=> 'COMBINED', // or null to inherit the global log_format
       ],
   ],
   

   use Illuminate\Support\Facades\Schedule;

   Schedule::command('goaccess:generate')->everyMinute()->withoutOverlapping();
   

'mode' => 'external',

'sites' => [
    'default' => [
        'label'     => 'My site',
        'json_path' => storage_path('app/goaccess/default.json'),
    ],
],

'sites' => [
    'marketing' => ['label' => 'Marketing', 'log_paths' => ['/var/log/nginx/marketing.log'], 'json_path' => storage_path('app/goaccess/marketing.json')],
    'app'       => ['label' => 'App',       'log_paths' => ['/var/log/nginx/app.log'],       'json_path' => storage_path('app/goaccess/app.json')],
],

GoAccessPlugin::make()
    ->navigationGroup('Reports')
    ->navigationSort(20)
    ->navigationIcon('heroicon-o-globe-alt');

'extra_args' => ['--no-global-config', '--geoip-database=/usr/share/GeoIP/GeoLite2-City.mmdb'],
bash
php artisan vendor:publish --tag="filament-goaccess-config"
bash
   php artisan goaccess:generate
   
bash
php artisan goaccess:generate app     # just the "app" site
php artisan goaccess:generate         # every site
bash
  php artisan goaccess:generate default --from=2024-01-01 --to=2024-01-31