Flex
137
2
Laravel

How can count table column unique values in Laravel 5.6?

Posted 6 months ago by Flex

working with laravel 5.6 and mysql. I have following table name as projects

id  name    type  
1   tuna        bio
2   nhye    IT
3   hyuj        bio
4   tour        IT
5   ghyt        commerce

I need count type column values which are unique values. as an example in above table I need count values 3 because there are three different values like bio, IT and commerce. how can I do this?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.