Skip to content

Instantly share code, notes, and snippets.

@likont
Created Dec 8, 2021
Embed
What would you like to do?
<?php
namespace shop\services\auth;
use shop\entities\User\User;
use shop\forms\auth\SignupForm;
use shop\repositories\UserRepository;
class SignupService
{
private $users;
public function __construct(UserRepository $users)
{
$this->users = $users;
}
public function signup(SignupForm $form, $ip, $partnerId)
{
$user = User::requestSignup(
$form->username,
$form->email,
$form->password,
$ip,
$partnerId
);
$this->users->add($user);
return $user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment