title: Cannot use object of type stdClass as array in Laravel blade template
body: <p>I am passing an array in Laravel blade template from controller. But it shows an error</p>
  
  <blockquote>
    <p>Cannot use object of type stdClass as array</p>
  </blockquote>
  
  <p>Here is the array which I passed to the view</p>
  
  <blockquote>
    <p>[[{"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":"lene@gmail.com","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":"lene@gmail.com","service_name":"Kneck pain"}]]</p>
  </blockquote>
  
  <p>Here is my blade template view where I got error</p>
  
  <pre><code>@foreach($doctor as $datum)
  &lt;div id="pg-112-0" class="panel-grid panel-no-style col-lg-12"&gt;
  
  @foreach($datum as $data)
  &lt;div id="pgc-112-0-0" class="panel-grid-cell col-lg-4"&gt;
    &lt;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"&gt;
  
      &lt;div class="person-profile h-card"&gt;
  
        &lt;div class="person-profile__container"&gt;
          &lt;div class="person-profile__basic-info"&gt;
  
            &lt;h4 class="person-profile__name  p-name"&gt;
              &lt;a href="{{ url('/doctor/'.str_slug($data["name"], "-").'-'.$data["id"] ) }}"&gt;
                Dr. {{ $data['name'] }}                                           
              &lt;/a&gt;
            &lt;/h4&gt;
            &lt;div class="person-profile__label"&gt;
              {{ $data['service_name'] }} Specialist
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;a class="btn  btn-secondary  btn-block  person-profile__button" href="{{ url('/doctor/'.str_slug($data["name"], "-").'-'.$data["id"] ) }}" target="_self"&gt;Read More&lt;/a&gt;
  
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  @endforeach
  
  &lt;/div&gt;
  
  @endforeach
  </code></pre>