Laravel save() - inserting the data instead update
<p>Want to updating the data using laravel. I make a function inside the model and using that method inside the controller but when calling the method its inserting the data with new id.function as following .</p>

<pre><code>public function edit_client($req,$id) { 
    $client = new client(); 
    $client-&gt;find($id); 
    $client-&gt;name = $req-&gt;name; 
    $client-&gt;address = $req-&gt;address; 
    $client-&gt;email = $req-&gt;email; 
    $client-&gt;phone = $req-&gt;phone; 
    $client-&gt;gender = $req-&gt;gender; 
    $client-&gt;department = $req-&gt;department; 
    $client-&gt;update();}
</code></pre>