get('tab')) { return redirect()->route('orders.index', ['tab' => 'all']); } return view('orders.index', [ 'tab' => $request->get('tab'), ]); } public function create() { return view('orders.create', [ 'order_types' => OrderType::cases(), 'order_status' => OrderStatus::cases(), 'customers' => Customer::all(), 'today' => Carbon::today()->format('Y-m-d'), 'due_default' => Carbon::today()->addDay(10)->format('Y-m-d') ]); } public function store(OrderRequest $request) { $order = Order::create($request->validated()); return redirect()->route('order-products.create', ['order' => $order->id]); } public function show($id) { return view('orders.show', [ 'order' => Order::find($id), 'tab' => 'details' ]); } public function edit($id) { } public function update(Request $request, $id) { } public function destroy($id) { } }