title: Array to string conversion - Laravel 5.6 Error
body: <p>I am trying to update values in the DB using values from a JSON file:</p>
  
  <p>Code:</p>
  
  <pre><code>$jsonData = file_get_contents($jsonFile);
          $data = json_decode($jsonData, true);
  
          //check if hospital exist
          $name = explode(' ',trim($data['organisationUnits']['organisationUnit']['name']));
          // echo $name[0];
          $query = Hospital::where('h_name',  'LIKE' , '%' . $data['organisationUnits']['organisationUnit']['name'] . '%')-&gt;first();
  
          if($query){
  
              // echo "\n yupo";
              $h_id = $query-&gt;id;
              $h_slug = $query-&gt;h_slug;
              $nr_orgUnit = $query-&gt;nr_orgUnit;
  
              // echo $nr_orgUnit;
              $updateHospital = Hospital::find($h_id);
              $updateHospital-&gt;h_name = $data["organisationUnits"]["organisationUnit"]["name"];
              $updateHospital-&gt;h_short_name = $data["organisationUnits"]["organisationUnit"]["shortName"];
              $updateHospital-&gt;h_code = $data["organisationUnits"]["organisationUnit"]["code"];
              $updateHospital-&gt;h_opening_date = $data["organisationUnits"]["organisationUnit"]["openingDate"];
              $updateHospital-&gt;h_closed_date = $data["organisationUnits"]["organisationUnit"]["closedDate"];
              $updateHospital-&gt;h_active = $data["organisationUnits"]["organisationUnit"]["active"];
              $updateHospital-&gt;h_comment = $data["organisationUnits"]["organisationUnit"]["comment"];
              $updateHospital-&gt;h_geo_code = $data["organisationUnits"]["organisationUnit"]["geoCode"];
              $updateHospital-&gt;h_last_updated = $data["organisationUnits"]["organisationUnit"]["lastUpdated"];
              $updateHospital-&gt;save();
  } else {
              // echo 'error';
          }
  </code></pre>
  
  <p>JSON DATA:</p>
  
  <pre><code> {"organisationUnits":{
    "organisationUnit":{
       "id":"01",
       "uuid":{
  
       },
       "name":"Isagehe Dispensary",
       "shortName":"Isagehe Dispensary ",
       "code":"17-04-0118",
       "openingDate":"1990-01-01",
       "closedDate":{
  
       },
       "active":"true",
       "comment":{
  
       },
       "geoCode":{
  
       },
       "lastUpdated":{
  
       }
    }
  }
  }
  </code></pre>
  
  <p>when i try to run the code, i get the following error: </p>
  
  <blockquote>
    <p>Array to string conversion (SQL: update `ag_hospitals` set `h_closed_date` = , `h_active` = true, `h_comment` = , `h_geo_code` = , `h_last_updated` =  where `id` = 41)"</p>
  </blockquote>
  
  <p>where might i be wrong?</p>
  
  <p>Note i have also tried updating the following way:</p>
  
  <pre><code>$updateHospital = Hospital::where('id', $h_id)-&gt;update([
                                  'h_name' =&gt; $data['organisationUnits']['organisationUnit']['name'], 
                                  'h_short_name' =&gt; $data['organisationUnits']['organisationUnit']['shortName'], 
                                  'h_code' =&gt; $data['organisationUnits']['organisationUnit']['code'], 
                                  'h_opening_date' =&gt; $data['organisationUnits']['organisationUnit']['openingDate'], 
                                  'h_closed_date' =&gt; $data['organisationUnits']['organisationUnit']['closedDate'], 
                                  'h_active' =&gt; $data['organisationUnits']['organisationUnit']['active'], 
                                  'h_comment' =&gt; $data['organisationUnits']['organisationUnit']['comment'], 
                                  'h_geo_code' =&gt; $data['organisationUnits']['organisationUnit']['geoCode'], 
                                  'h_last_updated' =&gt; $data['organisationUnits']['organisationUnit']['lastUpdated']
                              ]);
  </code></pre>