first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?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 уже зарегистрирован аккаунт.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user