Skip to content

Commit

Permalink
investigate cause of log in issue: return same object
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Apr 11, 2024
1 parent 792fefa commit 6fe50ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ protected function casts(): array
}

/**
* @return $this
* @param string $email
* @param string $ssoType
* @param string $name
* @param string $username
* @param int $ssoId
* @return Model
*/
public static function create(string $email, string $ssoType, string $name, string $username, int $ssoId): Model
{
return self::query()->firstOrCreate(
$user = self::query()->firstOrCreate(
[
'email' => $email,
],
Expand All @@ -68,6 +73,7 @@ public static function create(string $email, string $ssoType, string $name, stri
'username' => $username,
]
);
return self::query()->where('email', $email)->firstOrFail();
}

public function getPupilsOfParent(): Collection
Expand Down

0 comments on commit 6fe50ba

Please sign in to comment.