Am using laravel5.4,
Am getting the object as 
[
1,
1,
1,
1
]

I want the duplicates to be removed and display the result as 
[1]

How can I do it?
I tried to covert it into array and used array\_unique function. But it doesn't work.