request = $request; $this->address = $address; $this->delivery_price = $delivery_price; $this->currency = $currency; $this->price_product = $product_total; } /** * @return mixed */ public function handle() { return Order::create([ 'user_id' => auth()->user()->id, 'address_id' => $this->address === null ? null : $this->address->id, 'type_delivery' => $this->request->delivery_type, 'price_delivery' => $this->delivery_price, 'currency' => $this->currency, 'payment_type' => $this->request->payment_type, 'payment_status' => $this->request->getPaymentStatus(), 'comment' => $this->request->address['comment'], 'price_product' => $this->price_product ]); } }