title: htmlspecialchars() expects parameter 1 to be string, array laravel?
body: <p>When doing the foreach this error occurs:</p>
  
  <p>ErrorException in helpers.php line 532:
  htmlspecialchars() expects parameter 1 to be string, array given</p>
  
  <pre class="lang-json prettyprint-override"><code>array:90 [▼
        1 =&gt; array:5 [▼
                      "users_responsavel_id" =&gt; 2
                      "users_responsavel_nome" =&gt; "Freitas"
                      "users_responsavel_cgu_cpf" =&gt; "1185420"
                      "status" =&gt; 1
                      "numero_chave" =&gt; "13"
                     ]
        2 =&gt; 14
        4 =&gt; array:5 [▼
                      "users_responsavel_id" =&gt; 4
                      "users_responsavel_nome" =&gt; "Ana virgulina"
                      "users_responsavel_cgu_cpf" =&gt; "545687"
                      "status" =&gt; 1
                      "numero_chave" =&gt; "15"
                     ]
        6 =&gt; array:2 [▼
                      "chave_invalida_numero" =&gt; 16
                      "chave_invalida_status" =&gt; true
                     ]
        7 =&gt; 17
        8 =&gt; 18
        9 =&gt; 19
        11 =&gt; array:2 [▼
                       "chave_invalida_numero" =&gt; 20
                       "chave_invalida_status" =&gt; true
                      ]
        13 =&gt; array:2 [▼
                       "chave_invalida_numero" =&gt; 21
                       "chave_invalida_status" =&gt; true
                      ]
        22 =&gt; 26
        23 =&gt; 27
        24 =&gt; 28
        25 =&gt; 29
        26 =&gt; 30
       ]
  
  
  &lt;div class="card-deck" id="chaves_geradas"&gt;
                  @foreach($b_c_d_c_a as $key =&gt; $value)
                      @if (is_array($value) || is_object($value))
                          @foreach ($value as $key_obj =&gt; $value_obj)
                              @if (in_array($key_obj == 'chave_invalida_numero', $value))
                              &lt;div class="card mb-3 text-center card-inverse card-primary-transparent" style="line-height: 0;padding-top: 20px;padding-bottom: 5px;color: rgb(1, 255, 116);background-color: rgb(38, 50, 56);cursor: not-allowed;" data-toggle="tooltip" data-html="true" data-placement="top" title="Chave inválida."&gt;
                                  &lt;div class="card-block"&gt;
                                      &lt;span class="fa-stack" style="font-size: 45px;margin-top: -30px;margin-right: -20px;margin-bottom: -25px;x;margin-left: -20px;"&gt;
                                          &lt;div class="fa-stack-1x" style="font-size: 65px;margin-top: -5px;"&gt;
                                          {{ $value_obj }}  
                                          &lt;/div&gt;
                                      &lt;/span&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              @elseif (in_array($key_obj == 'numero_chave', $value))
                              &lt;div class="card mb-3 text-center card-inverse card-primary-transparent" style="line-height: 0;padding-top: 20px;padding-bottom: 5px;color: rgb(1, 255, 116);background-color: rgb(38, 50, 56);cursor: not-allowed;" data-toggle="tooltip" data-html="true" data-placement="top" title="Chave com usuário."&gt;
                                  &lt;div class="card-block"&gt;
                                      &lt;span class="fa-stack" style="font-size: 45px;margin-top: -30px;margin-right: -20px;margin-bottom: -25px;x;margin-left: -20px;"&gt;
                                          &lt;div class="fa-stack-1x" style="font-size: 65px;margin-top: -5px;"&gt;
                                          {{ $value_obj }}
                                          &lt;/div&gt;
                                      &lt;/span&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              @endif
                          @endforeach
  
                      @else
  
                          &lt;div class="card mb-3 text-center card-inverse card-primary-transparent" style="line-height: 0;padding-top: 20px;padding-bottom: 5px;"&gt;
                              &lt;div class="card-block n_chaves" numero_chave="{{ $value }}"&gt;
                              &lt;p style="font-size: 65px;"&gt;{{ $value }}&lt;/p&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                      @endif
                  @endforeach
              &lt;/div&gt;
  </code></pre>
  
  <p>I am generating these objects to manage a set of keys in a sector.</p>
  
  <p>Can someone help me find a way to do this code.</p>