Add the sliced onions and butter to the slow cooker and stir until the onions are coated.
Pour in the beef broth, then add the garlic, thyme, bay leaves, salt, and pepper.
Stir everything together, cover the slow cooker, and cook on low for 8 hours until the onions are very soft.
Remove and discard the bay leaves before serving.
Ladle the soup into four bowls and divide the shredded Gruyère evenly across the top of each bowl.