/
home
/
techb158
/
immovalet.com
/
platform
/
core
/
acl
/
src
/
Services
/
/home/techb158/immovalet.com/platform/core/acl/src/Services
mkdir
upload
Name
Size
Mode
Actions
ActivateUserService.php
1197
0644
edit
dl
rm
ChangePasswordService.php
1494
0644
edit
dl
rm
CreateUserService.php
2137
0644
edit
dl
rm
Edit:
/home/techb158/immovalet.com/platform/core/acl/src/Services/ActivateUserService.php
(1197B)
<?php namespace Botble\ACL\Services; use Botble\ACL\Models\User; use Botble\ACL\Repositories\Interfaces\ActivationInterface; use InvalidArgumentException; class ActivateUserService { /** * @var ActivationInterface */ protected $activationRepository; /** * ActivateUserService constructor. * @param ActivationInterface $activationRepository */ public function __construct(ActivationInterface $activationRepository) { $this->activationRepository = $activationRepository; } /** * Activates the given user. * * @param User $user * @return bool * @throws InvalidArgumentException */ public function activate($user) { if (!$user instanceof User) { throw new InvalidArgumentException('No valid user was provided.'); } if ($this->activationRepository->completed($user)) { return false; } event('acl.activating', $user); $activation = $this->activationRepository->createUser($user); event('acl.activated', [$user, $activation]); return $this->activationRepository->complete($user, $activation->code); } }
Save
cmd:
run