Skip to content

Commit

Permalink
Set system timezone by default for users created outside of web inter…
Browse files Browse the repository at this point in the history
…face - closes #3490
  • Loading branch information
freescout-help-desk committed Nov 1, 2023
1 parent bbfbd43 commit e652a1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ class User extends Authenticatable
'permissions' => 'array',
];

public function __construct(array $attributes = array())
{
$this->setRawAttributes(array_merge($this->attributes, array(
'timezone' => config('app.timezone') ?: User::DEFAULT_TIMEZONE
)), true);
parent::__construct($attributes);
}

/**
* For array_unique function.
*
Expand Down

0 comments on commit e652a1e

Please sign in to comment.