ToggleUserStatus
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- activate() : array{success: bool, error?: string}
- Activate a user.
- deactivate() : array{success: bool, error?: string}
- Deactivate a user.
Properties
$userRepository
private
UserRepositoryInterface
$userRepository
Methods
__construct()
public
__construct(UserRepositoryInterface $userRepository) : mixed
Parameters
- $userRepository : UserRepositoryInterface
activate()
Activate a user.
public
activate(int $userId, int $currentAdminId) : array{success: bool, error?: string}
Parameters
- $userId : int
-
The user to activate
- $currentAdminId : int
-
The admin performing the action
Return values
array{success: bool, error?: string}deactivate()
Deactivate a user.
public
deactivate(int $userId, int $currentAdminId) : array{success: bool, error?: string}
Parameters
- $userId : int
-
The user to deactivate
- $currentAdminId : int
-
The admin performing the action