<?php

namespace App\Listeners;

use App\Notifications\InformaciaPouzivatelNotification;
use stdClass;

/**
 * Class UdalostNotificationView
 *
 * @package App\Listeners
 */
final class InformaciaNotificationView
{
    /**
     * @param $notification
     *
     * @return \stdClass|null
     */
    public function handle($notification): ?object
    {
        if (is_a(InformaciaPouzivatelNotification::class, $notification->type, true)) {
            $obj = new stdClass;
            $obj->name = 'partials.notification-informacia';
            $obj->url = route(
                'portal.informacie.show',
                [
                    'informaciaId' => $notification->data['hash_id'],
                ],
            );

            return $obj;
        }

        return null;
    }
}
