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 .
public function edit_client($req,$id) {
$client = new client();
$client->find($id);
$client->name = $req->name;
$client->address = $req->address;
$client->email = $req->email;
$client->phone = $req->phone;
$client->gender = $req->gender;
$client->department = $req->department;
$client->update();}
$client = new client();.. remove or comment this line and try again.save()will insert new record.updated_atwill be updated automatically