|
|
@@ -0,0 +1,28 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Services;
|
|
|
+
|
|
|
+use App\Enums\LanguageEnum;
|
|
|
+use App\Enums\UserStatusEnum;
|
|
|
+use App\Enums\UserTypeEnum;
|
|
|
+use App\Models\User;
|
|
|
+use Illuminate\Support\Str;
|
|
|
+
|
|
|
+class LandingPageService
|
|
|
+{
|
|
|
+ public function registerUser(array $data): User
|
|
|
+ {
|
|
|
+ return User::create([
|
|
|
+ 'name' => $data['name'],
|
|
|
+ 'email' => $data['email'],
|
|
|
+ 'cpf' => $data['cpf'],
|
|
|
+ 'phone' => $data['phone'],
|
|
|
+ 'position_label' => $data['position_label'],
|
|
|
+ 'sector_label' => $data['sector_label'],
|
|
|
+ 'status' => UserStatusEnum::PENDING,
|
|
|
+ 'type' => UserTypeEnum::ASSOCIADO,
|
|
|
+ 'language' => LanguageEnum::PORTUGUESE,
|
|
|
+ 'password' => bcrypt(Str::random(32)),
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+}
|