Я передаю массив в шаблоне лезвия Laravel от контроллера. Но показывает ошибку
Cannot use object of type stdClass as array
Вот массив, который я передал представлению
[[{"id":10,"user_id":4,"service_speciality":"4","contact":"789","created_at":"2018-06-06 05:52:22","updated_at":"2018-06-06 05:52:22","branch_id":3,"name":"lene","doctor_email":"[email protected]","service_name":"Tooth pain"}],[{"id":8,"user_id":4,"service_speciality":"1","contact":"123","created_at":"2018-06-06 05:51:41","updated_at":"2018-06-06 05:51:41","branch_id":1,"name":"lene","doctor_email":"[email protected]","service_name":"Kneck pain"}]]
Вот мой шаблон клинка, где я получил ошибку
@foreach($doctor as $datum)
<div id = "pg-112-0" class = "panel-grid panel-no-style col-lg-12">
@foreach($datum as $data)
<div id = "pgc-112-0-0" class = "panel-grid-cell col-lg-4">
<div id = "panel-112-0-0-0" class = "so-panel widget widget_pw_person_profile widget-person-profile panel-first-child panel-last-child" data-index = "0">
<div class = "person-profile h-card">
<div class = "person-profile__container">
<div class = "person-profile__basic-info">
<h4 class = "person-profile__name p-name">
<a href = "{{ url('/doctor/'.str_slug($data["name"], "-").'-'.$data["id"] ) }}">
Dr. {{ $data['name'] }}
</a>
</h4>
<div class = "person-profile__label">
{{ $data['service_name'] }} Specialist
</div>
</div>
<a class = "btn btn-secondary btn-block person-profile__button" href = "{{ url('/doctor/'.str_slug($data["name"], "-").'-'.$data["id"] ) }}" target = "_self">Read More</a>
</div>
</div>
</div>
</div>
@endforeach
</div>
@endforeach






Сообщение об ошибке говорит само за себя. Измените свой код с:
$data['SOMETHING']
К
$data->SOMETHING
Пример от: $data['service_name'] до $data->service_name