Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. if ($user->save()) {
  2. $data = DB::table('posts')->get();
  3. $data = array(
  4. 'description' => $request->description,
  5. 'Location'=> $request->Location,
  6. 'lat' => $request->lat,
  7. 'lng' => $request->lng,
  8. );
  9. Mail::send('contact',$data,function($message) use($data) {
  10. //Mail has been sent but both the From and To email address are same
  11. // i.e. abc@gmail.com not Logged in user's email
  12. $message->from(Auth::user()->email);
  13. //to email address which i have hard coded
  14. $message->to('abc@gmail.com');
  15. $message->subject($data['Location']);
  16. });
  17. return redirect('/index');
  18. }
  19. }
  20.  
  21. if ($user->save()) {
  22. $data = DB::table('posts')->get();
  23. $data = array(
  24. 'description' => $request->description,
  25. 'Location'=> $request->Location,
  26. 'lat' => $request->lat,
  27. 'lng' => $request->lng,
  28. );
  29. if (Auth::check()
  30. {
  31. $email = User::whereId(Auth::user()->id)->value('email');
  32. }
  33. Mail::send('contact',$data,function($message) use($data) {
  34. //Mail has been sent but both the From and To email address are same
  35. // i.e. abc@gmail.com not Logged in user's email
  36. $message->from($email);
  37. //to email address which i have hard coded
  38. $message->to($email);
  39. $message->subject($data['Location']);
  40. });
  41. return redirect('/index');
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement