register() public méthode

Dynamic registration
public register ( )
 public function uma_register_client()
 {
     $practice = DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->first();
     $client_name = 'Practice NOSH for ' . $practice->practice_name;
     $patient = DB::table('demographics_relate')->where('pid', '=', Session::get('pid'))->where('practice_id', '=', Session::get('practice_id'))->first();
     $open_id_url = str_replace('/nosh', '/uma-server-webapp/', $patient->url);
     $url = route('uma_get_refresh_token');
     $oidc = new OpenIDConnectClient($open_id_url);
     $oidc->setClientName($client_name);
     $oidc->setRedirectURL($url);
     $oidc->register(true);
     $client_id = $oidc->getClientID();
     $client_secret = $oidc->getClientSecret();
     $data = array('uma_client_id' => $client_id, 'uma_client_secret' => $client_secret);
     DB::table('demographics_relate')->where('demographics_relate_id', '=', $patient->demographics_relate_id)->update($data);
     $this->audit('Update');
     return Redirect::to('chart');
 }
 public function uma_register_client()
 {
     $practice = DB::table('practiceinfo')->where('practice_id', '=', '1')->first();
     if ($practice->patient_centric == 'y') {
         $patient = DB::table('demographics')->first();
         $dob = date('m/d/Y', strtotime($patient->DOB));
         $client_name = 'PatientNOSH for ' . $patient->firstname . ' ' . $patient->lastname . ' (DOB: ' . $dob . ')';
     } else {
         $client_name = 'PracticeNOSH for ' . $practice->practice_name;
     }
     $open_id_url = 'http://162.243.111.18/uma-server-webapp/';
     $url = route('uma_auth');
     $oidc = new OpenIDConnectClient($open_id_url);
     $oidc->setClientName($client_name);
     $oidc->setRedirectURL($url);
     $oidc->register(true);
     $client_id = $oidc->getClientID();
     $client_secret = $oidc->getClientSecret();
     $data = array('uma_client_id' => $client_id, 'uma_client_secret' => $client_secret);
     DB::table('practiceinfo')->where('practice_id', '=', '1')->update($data);
     $this->audit('Update');
     return Redirect::intended('/');
 }