예제 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $order = Transaction::get_order($id);
     $id_product = $order->id_product;
     $transaction = Transaction::with('user')->where('id', '=', $id)->first();
     $id_user = $transaction->id_user;
     $products = Transaction::get_product($id);
     $profile = Profile::where('id_user', '=', $id_user)->first();
     return view('cart.final', compact('profile', 'transaction', 'products'));
 }
 public function send_order($id)
 {
     $transaction = Transaction::where('id', '=', $id)->with('user')->first();
     $id_user = $transaction->id_user;
     $products = Transaction::get_product($id);
     $profile = Profile::where('id_user', '=', $id_user)->first();
     $data = array('email' => $profile->email, 'from' => '*****@*****.**', 'name' => $profile->firstname . ' ' . $profile->lastname);
     Mail::send('email.transaction.order', compact('transaction', 'products', 'profile'), function ($message) use($data) {
         $message->to($data['email'])->from($data['from'], $data['name'])->subject('hairstuation.com: order product');
     });
 }