我正在尝试计算等于某个值的元素的数量,但是当我运行时,我很难找到我想要比较的元素:
{{dd($numberofnotifications)}}
我得到以下信息:
但我需要比较的值在“属性”下
那么我如何获得属性下的值?
当我打印出数组的每个元素时,我得到以下格式:
{"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"}