I am creating laravel Api for my project. I have a function to save new order. The problem is that I have related fields, based on id of order. How can I get order id before saving data to database? Cause now I am getting empty data for these fields: `$order->order_number = str_pad($order->id, 5, "0", STR_PAD_LEFT);` and `$order_products->order_id = $order->id`;

```
public function save_order(Request $request)
{
    $order = new Order();
    $order->order_number = str_pad($order->id, 5, "0", STR_PAD_LEFT);
    $order->user_id = $request->user_id; //нужен функционал выбора id / либо отправить с приложения id
    $order->address_id = $request->address_id; //нужен функционал выбора id
    $order->sum = $request->sum;
    $order->comment = $request->comment;
    $order->promo_id = $request->promo_id; //нужен функционал выбора id
    $order->sub_total = $request->sub_total;
    $order->discount = $request->discount;
    $order->delivery_charge = $request->delivery_charge;
    $order->payment_id = $request->payment_id; //нужен функционал выбора id
    $order->status = 1;

    $order_products = new OrderProducts();
    $order_products->order_id = $order->id;
    $order_products->product_id = $request->product_id;
    $order_products->quantity = $request->quantity;
    $order_products->price = $request->price;
    $order_products->save();
    $order->save();

    return response()
->json(['status' => true,
 'code' => 200 , 
 'message'=> 'sucessfull got all products', 
 'order' => $order,
 'order_products' => $order_products
 ]);

}

}

```