<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class EventDurationStat extends Model
{
    protected $keyType = 'string';
    public $incrementing = false;

    protected $fillable = [
        'user_id',
        'keyword',
        'avg_duration',
        'count',
    ];

    protected static function boot()
    {
        parent::boot();

        static::creating(function ($model) {
            if (!$model->id) {
                $model->id = (string) Str::uuid();
            }
        });
    }

}
