/** * @param RegisterRequest $request * @return \Illuminate\Http\RedirectResponse */ public function postRegister(RegisterRequest $request) { if (config('access.users.confirm_email')) { $this->auth->create($request->all()); return redirect()->route('home')->withFlashSuccess("Your account was successfully created. We have sent you an e-mail to confirm your account."); } else { // Use native auth login because do not need to check status when registering // User::create(auth()->login($this->auth->create($request->all()))); - NOT Working $getID = $price = DB::table('users')->max('id'); if (Input::get('phi_ref_number') != null) { User::create($request->all()); DB::table('permission_user')->insert(['permission_id' => '1', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '2', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '24', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '6', 'user_id' => $getID + 1]); } if (Input::get('moh_ref_number') != null) { User::create($request->all()); DB::table('permission_user')->insert(['permission_id' => '6', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '2', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '25', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '4', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '1', 'user_id' => $getID + 1]); } return Redirect::back(); } }
/** * @param RegisterRequest $request * @return \Illuminate\Http\RedirectResponse */ public function postRegister(RegisterRequest $request) { if (config('access.users.confirm_email')) { $this->auth->create($request->all()); return redirect()->route('home')->withFlashSuccess("Your account was successfully created. We have sent you an e-mail to confirm your account."); } else { $this->auth->login($this->auth->create($request->all())); return redirect()->route('frontend.dashboard'); } }
/** * @param RegisterRequest $request * * @return \Illuminate\Http\RedirectResponse */ public function postRegister(RegisterRequest $request) { if (config('access.users.confirm_email')) { $this->auth->create($request->all()); return redirect()->route('home')->withFlashSuccess('Your account was successfully created. We have sent you an e-mail to confirm your account.'); } else { //Use native auth login because do not need to check status when registering auth()->login($this->auth->create($request->all())); return redirect()->route('home'); } }
/** * @param RegisterRequest $request * @return \Illuminate\Http\RedirectResponse */ public function postRegister(RegisterRequest $request) { if (config('access.users.confirm_email')) { $this->auth->create($request->all()); return redirect()->route('home')->withFlashSuccess('Contul dvs a fost creat cu succes. Verificati email-ul pentru a confirma contul.'); } else { //Use native auth login because do not need to check status when registering auth()->login($this->auth->create($request->all())); return redirect()->route('frontend.dashboard'); } }
/** * @param RegisterRequest $request * @return \Illuminate\Http\RedirectResponse */ public function postRegister(RegisterRequest $request) { if (config('access.users.confirm_email')) { $this->auth->create($request->all()); return redirect()->route('home')->withFlashSuccess("Your account was successfully created. We have sent you an e-mail to confirm your account."); } else { //Use native auth login because do not need to check status when registering // User::create(auth()->login($this->auth->create($request->all()))); $getID = $price = DB::table('users')->max('id'); // if(Input::get('phi_ref_number')!=null) { // User::create($request->all()); $pass = Hash::make(Input::get('password')); DB::table('users')->insert(['name' => $request['name'], 'email' => $request['email'], 'password' => $pass, 'contact_number' => $request['contact_number'], 'status' => '1', 'confirmed' => '1']); DB::table('permission_user')->insert(['permission_id' => '1', 'user_id' => $getID + 1]); // DB::table('permission_user')->insert(['permission_id' => '2', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '23', 'user_id' => $getID + 1]); DB::table('permission_user')->insert(['permission_id' => '6', 'user_id' => $getID + 1]); // // } // // if(Input::get('moh_ref_number')!=null) // { // User::create($request->all()); // DB::table('permission_user')->insert( // [ // 'permission_id' => '6', // 'user_id' => $getID + 1 // ] // ); // DB::table('permission_user')->insert( // [ // 'permission_id' => '2', // 'user_id' => $getID + 1 // ] // ); // DB::table('permission_user')->insert( // [ // 'permission_id' => '25', // 'user_id' => $getID + 1 // ] // ); // DB::table('permission_user')->insert( // [ // 'permission_id' => '4', // 'user_id' => $getID + 1 // ] // ); // DB::table('permission_user')->insert( // [ // 'permission_id' => '1', // 'user_id' => $getID + 1 // ] // ); // } return Redirect::back(); } }
public function postRegister(RegisterRequest $request, $type = '') { $data = $request->all(); $data['confirmation_code'] = md5(uniqid(mt_rand(), true)); $data['confirmed'] = config('access.users.confirm_email') ? 0 : 1; $data['status'] = 1; if (config('access.users.confirm_email')) { $user = $this->auth->create($data); $user->attachRole(User::category()[$type]); return redirect()->route('home')->withFlashSuccess(trans('alerts.register.success')); } else { $user = $this->auth->create($data); $user->attachRole(User::category()[$type]); auth()->login($user); return redirect()->route('frontend.dashboard'); } }