Basic user management

This commit is contained in:
2026-02-05 00:46:22 +01:00
parent e280fcfba8
commit 11108bdfcc
55 changed files with 1524 additions and 54 deletions

View File

@@ -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;
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Domains\UserManagement\Actions\UserChangePassword;
use App\Models\User;
class UserChangePasswordRequest {
public User $user;
public string $newPassword;
public function __construct(User $user, string $newPassword) {
$this->user = $user;
$this->newPassword = $newPassword;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Domains\UserManagement\Actions\UserChangePassword;
class UserChangePasswordResponse {
public bool $success;
public function __construct() {
$this->success = false;
}
}