if(isset($request->purchase_code) && $request->purchase_code != ''){
$response = (new SuperAdminController)->curl_request($request->purchase_code);
if($response != 1) {
return redirect()->back()->with('error', get_phrase('Purchase code verification failed'));
} else{
$duplicate_code_check = DB::table('addons')->where('purchase_code', $request->purchase_code)->get();
if(count($duplicate_code_check) > 0){
return redirect()->back()->with('error', get_phrase('You have already use this purchase code'));
}
}
} else {
return redirect()->back()->with('error', get_phrase('Purchase code verification failed'));
}