private function findOrCreateUser($user) { $authUser = User::where('email', $user->email)->first(); if ($authUser) { return $authUser; } $newUser = new User(['name' => isset($user->name) ? $user->name : $user->nickname, 'email' => $user->email, 'contact_id' => 1]); $newUser->save(); $newUser->setUp(); return $newUser; }