title: Array to string conversion laravel 7
body: <p>i need to get the values without string in array. this will be name of fields :</p>
  
  <pre><code> static function showCust(){
     $table = DB::table("dummy_db.customer")-&gt;select("*")-&gt;paginate(10);
     $getFieldName = ["CUST_NAME", "CUST_CITY"];
  
     foreach($table as $items){
          $a[] = $items-&gt;$getFieldName[0];
     }
     dd($a);
  }
  </code></pre>
  
  <p>but the results : </p>
  
  <p><code>ErrorException
  Array to string conversion.
  </code></p>