예제 #1
0
 private function getRegisterAccount($post = NULL)
 {
     if (!is_null($post)) {
         $user = new User();
         $user->name = $post['name'];
         $user->surname = $post['surname'];
         $user->email = $post['email'];
         $user->active = 0;
         $user->password = Hash::make($post['password']);
         $user->photo = 'img/avatars/male.png';
         $user->thumbnail = 'img/avatars/male.png';
         $user->temporary_code = str_random(16);
         $user->code_life = myDateTime::getFutureDays(3);
         $user->save();
         $user->touch();
         $user->groups()->attach(2);
         return $user;
     }
     return FALSE;
 }
예제 #2
0
 private function getRegisterAccount($post = NULL)
 {
     $user = new User();
     if (!is_null($post)) {
         $user->group_id = Group::where('name', 'participant')->pluck('id');
         $user->name = $post['name'];
         $user->surname = '';
         $user->email = $post['email'];
         $user->active = $post['verified_email'] == 1 ? 1 : 0;
         $user->yad_name = '';
         $user->location = $post['location'];
         $user->age = $post['age'];
         $user->phone = $post['phone'];
         $user->social = !empty($post['social']) ? json_encode($post['social']) : json_encode(array());
         $user->video = '';
         $user->password = $post['password'];
         $user->photo = '';
         $user->thumbnail = '';
         $user->temporary_code = Str::random(24);
         $user->code_life = myDateTime::getFutureDays(5);
         $user->save();
         $user->touch();
         return $user;
     }
     return FALSE;
 }