PHP code example of filahq / statify

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

    

filahq / statify example snippets


// config/statify.php

return [
    'guard' => env('STATIFY_GUARD', 'token'), // "token" or "sanctum"
    'token' => env('STATIFY_TOKEN'),           // for "token" guard; null = open access
    'cache_ttl' => 60,                         // seconds
    'cache_prefix' => 'statify',
    'prefix' => 'api/statify',
];

use FilaHQ\Statify\Statify;

Statify::widgets([
    RevenueStatsWidget::class,
    UsersStatsWidget::class,
]);

use FilaHQ\Statify\StatifyPlugin;

$panel->plugin(
    StatifyPlugin::make()->widgets([
        RevenueStatsWidget::class,
        UsersStatsWidget::class,
    ])
);

$token = $user->createToken('statify')->plainTextToken;
bash
php artisan vendor:publish --tag=statify-config