mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 02:02:15 +01:00
Fixed user create in filament
This commit is contained in:
@@ -12,11 +12,12 @@ use App\Models\Organization;
|
||||
use App\Models\ProjectMember;
|
||||
use App\Models\TimeEntry;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class UserService
|
||||
{
|
||||
public function createUser(string $name, string $email, string $password, string $timezone, Weekday $weekStart, string $currency): User
|
||||
public function createUser(string $name, string $email, string $password, string $timezone, Weekday $weekStart, string $currency, bool $verifyEmail = false): User
|
||||
{
|
||||
$user = new User;
|
||||
$user->name = $name;
|
||||
@@ -24,6 +25,9 @@ class UserService
|
||||
$user->password = Hash::make($password);
|
||||
$user->timezone = $timezone;
|
||||
$user->week_start = $weekStart;
|
||||
if ($verifyEmail) {
|
||||
$user->email_verified_at = Carbon::now();
|
||||
}
|
||||
$user->save();
|
||||
|
||||
$organization = new Organization;
|
||||
|
||||
Reference in New Issue
Block a user