<?php

namespace App\Http\Controllers\API\V1\Pouzivatel\Notifications\Transformers;

use Illuminate\Notifications\DatabaseNotification;
use PHPOpenSourceSaver\Fractal\TransformerAbstract;

/**
 * Class NotificationTransformer
 */
class NotificationTransformer extends TransformerAbstract
{
    public function transform(DatabaseNotification $notification): array
    {
        return [
            'id' => $notification->id,
            'type' => $notification->type,
            'notifiable_type' => $notification->notifiable_type,
            'notifiable_id' => $notification->notifiable_id,
            'data' => $notification->data,
            'read_at' => $notification->read_at,
            'created_at' => $notification->created_at,
            'updated_at' => $notification->updated_at,
            'links' => [
                'self' => null,
            ],
        ];
    }
}
