private function _createUser() { $email = strtolower(str_random()) . "@gmail.com"; $password = bcrypt('admin123'); $user = User::create(['first_name' => 'First Name Test', 'last_name' => 'Last Name Test', 'email' => $email, 'password' => $password]); return $user; }
public function sendEmailInvoice($id) { $order = Order::findorfail($id); $user = User::find($order->user_id); $view = view('admin.order.pdf')->with('order', $order); $path = public_path('/uploads/order/invoice/' . $order->id . '.pdf'); PDF::loadHTML($view->render())->save($path); Mail::to($user->email)->send(new OrderInvoicedMail($order, $path)); }
public function postUser(CheckoutUserRequest $request) { $orderData = Session::get('order_data'); $request->merge(['password' => bcrypt($request->get('password'))]); $user = User::create($request->all()); Auth::guard('web')->login($user); $orderData['user_id'] = $user->id; Session::put('order_data', $orderData); return redirect()->route('checkout.step.shipping-address'); }
public function sendEmailInvoice($id) { $order = Order::findorfail($id); $user = User::find($order->user_id); $view = view('order.pdf')->with('order', $order); $path = public_path('/uploads/order/invoice/' . $order->id . '.pdf'); PDF::loadHTML($view->render())->save($path); Mail::to($user->email)->send(new OrderInvoicedMail($order, $path)); //Mail::send(); //dd($view->render());die; //PDF::loadHTML($view->render())->save('my_stored_file.pdf')->stream('download.pdf'); //return redirect()->back(); }
public function store(ReviewRequest $request) { if (!Auth::check()) { $user = User::where('email', '=', $request->get('email'))->get()->first(); if (null === $user) { $request->merge(['password' => str_random($length = 6)]); $user = User::create($request->all()); } } else { $user = Auth::user(); } $request->merge(['user_id' => $user->id]); Review::create($request->all()); return redirect()->back(); }
private function _createFrontUser() { if (count(User::where('email', '=', '*****@*****.**')->get()) <= 0) { User::create(['first_name' => 'test User', 'last_name' => 'test User', 'email' => '*****@*****.**', 'password' => bcrypt('admin123')]); } }
/** * Create a new user instance after a valid registration. * * @param array $data * * @return User */ protected function create(array $data) { return User::create(['first_name' => $data['first_name'], 'last_name' => $data['last_name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }