<?php

/*
    Created by Mohamed.
*/


namespace App\Http\Resources;

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

class PointsTransactionResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'points' => $this->points,
            'action_type' => $this->action_type,
            'related_id' => $this->related_id,
            'status' => $this->status,
            'platform' => $this->platform,


            'date' => $this->created_at->format('m/d/Y'),
            'time' => $this->created_at->format('H:i:s'),
        ];
    }
}