<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WifiSession extends Model
{
    protected $fillable = ['user_id', 'wifi_router_id', 'duration', 'data_used', 'started_at', 'ended_at'];

    protected $casts = [
        'started_at' => 'datetime',
        'ended_at' => 'datetime',
    ];

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

    public function router()
    {
        return $this->belongsTo(WifiRouter::class, 'wifi_router_id');
    }
}
