<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ApiKey extends Model
{
    protected $fillable = [
        'user_id', 'public_key', 'secret_key', 'webhook_url', 'is_active', 'name', 'abilities', 'expires_at'
    ];

    protected $casts = [
        'abilities' => 'array',
        'expires_at' => 'date',
        'is_active' => 'boolean',
    ];

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