mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
2.x - databases
This commit is contained in:
@ -13,14 +13,14 @@ public function update(User $user, array $input): void
|
||||
$this->validate($input);
|
||||
$user->projects()->sync($input['projects']);
|
||||
|
||||
if ($user->currentProject && !$user->projects->contains($user->currentProject)) {
|
||||
if ($user->currentProject && ! $user->projects->contains($user->currentProject)) {
|
||||
$user->current_project_id = null;
|
||||
$user->save();
|
||||
}
|
||||
|
||||
/** @var Project $firstProject */
|
||||
$firstProject = $user->projects->first();
|
||||
if (!$user->currentProject && $firstProject) {
|
||||
if (! $user->currentProject && $firstProject) {
|
||||
$user->current_project_id = $firstProject->id;
|
||||
$user->save();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public static function rules(User $user): array
|
||||
'email' => [
|
||||
'required',
|
||||
'email', 'max:255',
|
||||
Rule::unique('users', 'email')->ignore($user->id)
|
||||
Rule::unique('users', 'email')->ignore($user->id),
|
||||
],
|
||||
'timezone' => [
|
||||
'required',
|
||||
|
Reference in New Issue
Block a user