Пример #1
0
 public function getEdit($id)
 {
     if ($id) {
         //details
         return view('admin.orders.details', ['products' => OrderProduct::where('order_id', $id)->get(), 'order' => Order::find($id)]);
     }
 }
Пример #2
0
 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('Новый заказ');
     });
 }
Пример #3
0
 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()]);
     }
 }