title: Object at controller suddenly become array at view
body: <p>anyone can explain why this happen?
  i cant access my data at view because it suddenly change to array. I try to check it using var_dumb
  at controller</p>
  <pre><code>public function render()
  {
      var_dump($this-&gt;provinces);
      return view('livewire.user-address-form');
  }
  
  public function mount()
  {
      $provinces = Shipment::getProvince();
      if($provinces-&gt;code !== 200)
      {
          abort($provinces-&gt;code, $provinces-&gt;message);
      }
      else
      {
          $this-&gt;provinces = $provinces-&gt;data;
      }
  }
  </code></pre>
  <p>getProvince() method is an API call with the response like <a href="https://i.stack.imgur.com/sXr9e.png" rel="nofollow noreferrer">this image</a>. Then I assign $this-&gt;province to &quot;data&quot;</p>
  <p>the result from var_dump is like this:</p>
  <pre><code>array(34) { [0]=&gt; object(stdClass)#1417 (2) { [&quot;province_id&quot;]=&gt; string(1) &quot;1&quot; [&quot;province&quot;]=&gt; string(4) &quot;Bali&quot; } [1]=&gt; object(stdClass)#1411 (2) { [&quot;province_id&quot;]=&gt; string(1) &quot;2&quot; [&quot;province&quot;]=&gt; string(15) &quot;Bangka Belitung&quot; } [2]=&gt; object(stdClass)#1429 (2)...
  </code></pre>
  <p>at view I have code like this:</p>
  <pre><code>&lt;select wire:model.debounce.800ms=&quot;provinceId&quot; id=&quot;provinceId&quot;
      class=&quot;form-select block rounded-md shadow-sm mt-1 w-full&quot;&gt;
      &lt;option value=&quot;&quot;&gt;-&lt;/option&gt;
      @foreach($provinces as $province)
          &lt;option&gt;{{ var_dump($province) }}&lt;/option&gt;
      @endforeach
  &lt;/select&gt;
  </code></pre>
  <p>and the result are like <a href="https://i.stack.imgur.com/u6da8.png" rel="nofollow noreferrer">this image</a></p>
  <p>edited:
  I found this problem when trying to access my data at view. when i using object property syntax it got error &quot;trying to get property of non-object laravel&quot;, and when I try using array syntax it got error &quot;Cannot use object of type stdClass as array&quot;. I already have the solution but i dont like (encode to json then decode to array). just wanna know why this happen.</p>