Laravel Many-to-Many: Get Unique Values with Collections Pluck
Let me show you a chain of Collection methods to get the colors of products for the dropdown. Imagine you have an e-shop, and you want to list the products of a category, also listing all different colors of those products, for a filter dropdown/checkbox. How to do it?