public function getEdit($id) { if ($id) { //details return view('admin.orders.details', ['products' => OrderProduct::where('order_id', $id)->get(), 'order' => Order::find($id)]); } }
private function send_new_order_email(Order $order) { $emails = \App\Models\Mail::actives(); $order_products = OrderProduct::where('order_id', $order->id)->get(); return Mail::send('emails.new_order', ['order' => $order, 'order_products' => $order_products], function ($message) use($emails) { $message->to($emails)->from('*****@*****.**')->subject('Новый заказ'); }); }
public function getOrders($id = null) { if ($id) { //details return view('order.details', ['products' => OrderProduct::where('order_id', $id)->get(), 'order' => Order::find($id)]); } else { return view('order.index', ['orders' => Order::where('user_id', Auth::id())->get()]); } }