Update records in elasticsearch-laravel;
<p>I want to update record of elasticsearch. I am passing whole record in $data to elasticsearch for update.</p>
<p><strong>Update code :</strong></p>
<pre><code>public function updateEs($data)
    {
        $params = array();
        $params['index'] = \App::environment();
        $params['type'] = $data['context'];
        $model = new \Modules\Catalog\Repositories\ProductRepo;

        $form = $model-&gt;loadProduct($data['id']);// whole data come from database 
        $data=(object)$form; //array to object
        
            $data['body'] = $data;
            $data['index'] = 'my_index';
            $data['type'] = 'product';
            $data['id' ]= $data['id'];
        
        $response = \Es::update($data);
    }
</code></pre>
<p><strong>But I am getting ERROR :</strong></p>
<blockquote>
<p>FatalErrorException in ElasticSearchHelper.php line 121:</p>
<p>Cannot use object of type stdClass as array</p>
</blockquote>