public function update(CustIdRequest $request, $id)
42
{
43
1
$cust = Customer::findOrFail($id);
44
45
try{
46
1
$cust->update($request->only(['cust_id']));
47
}
48
catch(QueryException $e)
49
{
50
Log::error('Update Customer ID failed');
51
Log::error($e);
52
return redirect()->back()->with(['message' => 'Unable to Update Customer ID for linked Customers', 'type' => 'danger']);
53
}
54
55
1
Log::channel('cust')->notice('Customer ID has been updated for Customer '.$cust->name.' from '.$id.' to '.$request->cust_id.' by '.$request->user()->username);