<?php

namespace App\Models;

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

class Subscriber extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'email',
        'phone',
        'type',
        'status',
        'username',
        'password',
        'mac_address',
        'ip_address',
        'nas_router',
        'plan_name',
        'plan_price',
        'expiry_date',
        'last_online',
        'balance',
        'address',
    ];

    protected $casts = [
        'expiry_date' => 'date',
        'last_online' => 'datetime',
    ];

    public function tickets()
    {
        return $this->hasMany(Ticket::class);
    }

    public function sessions()
    {
        return $this->hasMany(NetworkSession::class);
    }
}
