public function createOrder()

in app/Http/Controllers/Api/OrdersController.php [27:37]


    public function createOrder(Request $request)
    {
        $customer = Customers::findOrFail($request->get('customer_id'));

        $order = Orders::create([
            'created_at' => Carbon::now()->format('Y-m-d'),
            'customer_id' => $customer->id
        ]);

        return $order;
    }