I am trying to count the number of elements that are equal to a certain value but im struggling to get to the element that i want to compare, when i run:
{{dd($numberofnotifications)}}
I get the following:
But the value i need to compare is under 'attributes'
so how do i get to the values under attributes?
When i print out each element of the array i get the following format:
{"id":"96a40ebb-a2d1-44d8-9600-e94dd026f152","type":"App\\Notifications\\CommentCreated","notifiable_type":"App\\User","notifiable_id":1,"data":{"comment_id":9,"data":{"name":"John","date":"2020-12-30T08:37:47.000000Z","email":"John@gmail.com","post":2,"body":"test"},"message":"John commented on your post"},"read_at":null,"created_at":"2020-12-30T08:37:47.000000Z","updated_at":"2020-12-30T08:37:47.000000Z"}