<?php

namespace App\Listeners;

use App\Events\UserLoggedIn;
use Illuminate\Contracts\Queue\ShouldQueue;

/**
 * Class NastavitDatumovuPeciatkuPoslednehoPrihlasenia
 *
 * @package App\Listeners
 */
final class NastavitDatumovuPeciatkuPoslednehoPrihlasenia implements ShouldQueue
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @return void
     */
    public function handle(UserLoggedIn $event)
    {
        $event
            ->pouzivatel
            ->update([
                'datum_posledneho_prihlasenia' => $event->casovaPeciatka,
            ]);
    }
}
