complete 2.5 with qa tests
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -43,6 +44,8 @@ new class extends Component {
|
||||
{
|
||||
$validated = $this->validate();
|
||||
|
||||
$plainPassword = $validated['password'];
|
||||
|
||||
$user = User::create([
|
||||
'user_type' => UserType::Company,
|
||||
'full_name' => $validated['company_name'],
|
||||
@@ -52,7 +55,7 @@ new class extends Component {
|
||||
'contact_person_id' => $validated['contact_person_id'],
|
||||
'email' => $validated['email'],
|
||||
'phone' => $validated['phone'],
|
||||
'password' => Hash::make($validated['password']),
|
||||
'password' => Hash::make($plainPassword),
|
||||
'preferred_language' => $validated['preferred_language'],
|
||||
'status' => UserStatus::Active,
|
||||
]);
|
||||
@@ -67,6 +70,8 @@ new class extends Component {
|
||||
'created_at' => now(),
|
||||
]);
|
||||
|
||||
$user->notify(new WelcomeAccountNotification($plainPassword));
|
||||
|
||||
session()->flash('success', __('clients.company_created'));
|
||||
|
||||
$this->redirect(route('admin.clients.company.index'), navigate: true);
|
||||
|
||||
Reference in New Issue
Block a user