trace; Cart::create([ 'invoice_id' => $transaction->invoice->id, 'trace' => $trace, ]); Invoice::find($transaction->invoice->id)->update(['paid' => 2]); if($request->ajax()){ return response()->json([ 'data' => true, 'message'=>'ok', 'status' => 200 ]); } return header('Location: '.url('/panel/wallet')); } /** * @param Request $request * @return array */ public function response(Request $request){ return ['status'=>true,'transaction'=>$request->transaction]; } }