<?php

namespace App\Http\Resources\Users;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class LoginActivityResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'user_id' => $this->resource['user_id'] ?? null,
            'email' => $this->resource['email'] ?? null,
            'login_time' => $this->resource['login_time'] ?? null,
            'logout_time' => $this->resource['logout_time'] ?? null,
            'ip_address' => $this->resource['ip_address'] ?? null,
            'user_agent' => $this->resource['user_agent'] ?? null,
        ];
    }
}
