PHP code example of lulzshadowwalker / laravel-metrics
1. Go to this page and download the library: Download lulzshadowwalker/laravel-metrics 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/ */
lulzshadowwalker / laravel-metrics example snippets
use Metrics\Traits\HasMetrics;
class Tenant extends Model
{
use HasMetrics;
}
enum Metric: string
{
case SignedUp = 'signed_up';
case OrderPlaced = 'order_placed';
case HumanEscalated = 'human_escalated';
}
$tenant->record(Metric::OrderPlaced, ['channel' => 'web']);
// meta is optional
$tenant->record(Metric::HumanEscalated);