コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function post_register(PatientRegRequest $request)
 {
     //
     $input = $request->all();
     $password = bcrypt($request->input('password'));
     $input['password'] = $password;
     $input['activation_code'] = str_random(60) . $request->input('email');
     $register = \App\Patient::create($input);
     $data = ['first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'code' => $input['activation_code']];
     $this->sendEmail($data, $input);
     Session::flash('success', "Cek email untuk mengaktivasi akun");
     return redirect()->route('patient.register');
 }
コード例 #2
0
 public function post_register(PatientRegRequest $request)
 {
     $role = \App\Role::where('default', '1')->first();
     $input = $request->all();
     $password = bcrypt($request->input('password'));
     $input['password'] = $password;
     $input['activation_code'] = str_random(10) . $request->input('email');
     $register = \App\User::create($input);
     $register->password = $password;
     $register->save();
     $register->roles()->attach($role->id);
     $data = ['first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'code' => $input['activation_code']];
     // $this->sendEmail($data, $input);
     Session::flash('success', "Silakan periksa email anda untuk mengaktifkan akun Anda. Jika dalam kurun waktu 24 jam Anda tidak menerima email dari kami, Anda dapat menghubungi kami melalui email di <a href='mailto:support@dokternet.com'>support@dokternet.com</a>");
     return redirect()->route('patient.register');
 }