refactor: remoção de lógica de negócio duplicada.

This commit is contained in:
lukibeg 2025-11-08 19:52:13 -03:00
parent dcb9d796d1
commit 875f856660
2 changed files with 2 additions and 5 deletions

View File

@ -10,7 +10,8 @@ class ClientService
{
public function __construct(protected Client $client) {}
public function addClient($client) {
public function addClient(array $client)
{
return Client::create($client);
}
}

View File

@ -11,10 +11,6 @@ class UserService
public function __construct(protected User $user) {}
public function createUser(array $user)
{
if (User::where('email', '=', $user['email'])) {
throw new \Exception('O e-mail já está cadastrado.');
}
return User::create($user);
}
}