<?php

declare(strict_types=1);

namespace App\Exceptions\Pouzivatel;

use Exception;
use Illuminate\Contracts\Auth\Authenticatable;

/**
 * Class PouzivatelJeBlokovany
 */
final class PouzivatelJeBlokovany extends Exception
{
    /**
     * @var string|null
     */
    protected $redirectTo;

    /**
     * PouzivatelJeBlokovany constructor.
     */
    public function __construct(Authenticatable $pouzivatel, ?string $redirectTo = null)
    {
        parent::__construct(sprintf('Používateľ %s je blokovaný.', $pouzivatel->cele_meno));

        $this->redirectTo = $redirectTo;
    }

    /**
     * @return string|null
     */
    public function redirectTo()
    {
        return $this->redirectTo;
    }
}
