Melt the butter in a skillet over medium heat. Add the chopped onion and minced garlic, then cook until the onion softens.
Stir the flour into the skillet and cook for one minute to form a roux.
Transfer the roux mixture to the slow cooker. Add the broccoli florets, chicken broth, salt, and black pepper.
Cover and cook on low for 4 to 5 hours until the broccoli is tender.
Stir in the milk, then gradually add the shredded cheddar cheese while stirring until it melts and the soup thickens.