Files
moonwell-web/app/Exceptions/DuplicateGameAccountException.php
2026-03-11 22:04:36 +04:00

26 lines
610 B
PHP

<?php
namespace App\Exceptions;
use RuntimeException;
class DuplicateGameAccountException extends RuntimeException
{
public function __construct(
public readonly string $field,
string $message,
) {
parent::__construct($message);
}
public static function forUsername(): self
{
return new self('username', 'Такой игровой аккаунт уже существует.');
}
public static function forEmail(): self
{
return new self('email', 'На этот email уже зарегистрирован аккаунт.');
}
}