complete 2.5 with qa tests

This commit is contained in:
Naser Mansour
2025-12-26 16:19:55 +02:00
parent f508f2b7bf
commit 1376f86d79
11 changed files with 601 additions and 2 deletions
@@ -4,6 +4,7 @@ use App\Enums\UserStatus;
use App\Enums\UserType;
use App\Models\AdminLog;
use App\Models\User;
use App\Notifications\WelcomeAccountNotification;
use Illuminate\Support\Facades\Hash;
use Livewire\Volt\Component;
@@ -39,13 +40,15 @@ new class extends Component {
{
$validated = $this->validate();
$plainPassword = $validated['password'];
$user = User::create([
'user_type' => UserType::Individual,
'full_name' => $validated['full_name'],
'national_id' => $validated['national_id'],
'email' => $validated['email'],
'phone' => $validated['phone'],
'password' => Hash::make($validated['password']),
'password' => Hash::make($plainPassword),
'preferred_language' => $validated['preferred_language'],
'status' => UserStatus::Active,
]);
@@ -60,6 +63,8 @@ new class extends Component {
'created_at' => now(),
]);
$user->notify(new WelcomeAccountNotification($plainPassword));
session()->flash('success', __('clients.client_created'));
$this->redirect(route('admin.clients.individual.index'), navigate: true);