/** * @return \Illuminate\View\View */ public function index() { if (is_admin()) { $orders = $this->orderRepository->all(); } else { $orders = $this->orderRepository->getUsersOrders(Auth::user()->id); } return view('orders.index', compact('orders')); }
public function orders(OrderRepository $orders, OrderItemRepository $orderItems) { return view('admin.main')->with('orders', $orders->all()); }
/** * Return all the orders with their products and price/amount at given time * * @return \Illuminate\Database\Eloquent\Collection|static[] */ public function index() { $orders = $this->orderRepository->all(); return response()->json($orders, 200); }