Basic user management
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\UserManagement\Actions\UserChangePassword;
|
||||
|
||||
|
||||
class UserChangePasswordCommand {
|
||||
private UserChangePasswordRequest $request;
|
||||
|
||||
public function __construct(UserChangePasswordRequest $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function execute() : UserChangePasswordResponse {
|
||||
$response = new UserChangePasswordResponse();
|
||||
|
||||
$this->request->user->password = $this->request->newPassword;
|
||||
$this->request->user->save();
|
||||
|
||||
$response->success = true;
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user