<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UsageLog extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'ip_address',
        'emails_created_count',
        'emails_received_count',
        'emails_created_history',
        'emails_received_history',
    ];

    protected $casts = [
        'emails_created_history' => 'array',
        'emails_received_history' => 'array',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
