예제 #1
0
 public function run()
 {
     DB::table('users_info')->delete();
     UserInfo::create(['user_id' => '1', 'style' => 'competitive', 'lang_one' => 'C++', 'lang_two' => 'Python', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '6', 'style' => 'social', 'lang_one' => 'C++', 'lang_two' => 'Python', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '4', 'style' => 'social', 'lang_one' => 'C++', 'lang_two' => 'Python', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306', 'csci_406' => 'CSCI 406']);
     UserInfo::create(['user_id' => '3', 'style' => 'social', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '2', 'style' => 'competitive', 'lang_one' => 'Python', 'lang_two' => 'Java', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261']);
     UserInfo::create(['user_id' => '5', 'style' => 'competitive', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '7', 'style' => 'competitive', 'lang_one' => 'C++', 'lang_two' => 'Python', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306', 'csci_406' => 'CSCI 406']);
     UserInfo::create(['user_id' => '8', 'style' => 'social', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261']);
     UserInfo::create(['user_id' => '9', 'style' => 'social', 'lang_one' => 'C++', 'lang_two' => 'Java', 'lang_three' => 'Python', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306']);
     UserInfo::create(['user_id' => '10', 'style' => 'social', 'lang_one' => 'Python', 'lang_two' => 'Java', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306']);
     UserInfo::create(['user_id' => '11', 'lang_one' => 'Python', 'lang_two' => 'Java', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '12', 'lang_one' => 'C++', 'lang_two' => 'Python', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306']);
     UserInfo::create(['user_id' => '13', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '14', 'style' => 'competitive', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306', 'csci_406' => 'CSCI 406']);
     UserInfo::create(['user_id' => '15', 'style' => 'competitive', 'lang_one' => 'Python', 'lang_two' => 'C++', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306', 'csci_406' => 'CSCI 406']);
     UserInfo::create(['user_id' => '16', 'style' => 'competitive', 'lang_one' => 'Python', 'lang_two' => 'C++', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306', 'csci_406' => 'CSCI 406']);
     UserInfo::create(['user_id' => '17', 'lang_one' => 'Python', 'lang_two' => 'Java', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262']);
     UserInfo::create(['user_id' => '18', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306', 'csci_406' => 'CSCI 406']);
     UserInfo::create(['user_id' => '19', 'lang_one' => 'C++', 'lang_two' => 'Java', 'lang_three' => 'Python', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306']);
     UserInfo::create(['user_id' => '20', 'lang_one' => 'Python', 'lang_two' => 'C++', 'lang_three' => 'Java', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306']);
     UserInfo::create(['user_id' => '21', 'lang_one' => 'Java', 'lang_two' => 'Python', 'lang_three' => 'C++', 'csci_261' => 'CSCI 261', 'csci_262' => 'CSCI 262', 'csci_306' => 'CSCI 306']);
 }
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = User::create(['username' => $data['username'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     File::makeDirectory(public_path() . "/content/" . $user->username);
     File::makeDirectory(public_path() . "/content/" . $user->username . "/photos/");
     $dest = public_path() . "/content/" . $user->username . "/photos/profile.png";
     $file = public_path() . "/img/profile.png";
     File::copy($file, $dest);
     UserInfo::create(["user_id" => $user->id, "photo" => "/content/" . $user->username . "/photos/profile.png"]);
     return $user;
 }
 public function store(Request $request)
 {
     $this->validate($request, ['username' => 'required|unique:users', 'password' => 'required|confirmed', 'email' => 'required']);
     $user = User::create(['username' => $request->username, 'password' => bcrypt($request->password), 'email' => $request->email]);
     $user->isAdmin = $request->isAdmin;
     $user->save();
     File::makeDirectory(public_path() . "/content/" . $user->username);
     File::makeDirectory(public_path() . "/content/" . $user->username . "/photos/");
     $dest = public_path() . "/content/" . $user->username . "/photos/profile.png";
     $file = public_path() . "/img/profile.png";
     File::copy($file, $dest);
     UserInfo::create(["user_id" => $user->id, "photo" => "/content/" . $user->username . "/photos/profile.png"]);
     return \Redirect('/admin/users')->with(['flash_message' => 'User Successfully Added !']);
 }
예제 #4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $user = User::create(['username' => 'admin', 'email' => '*****@*****.**', 'password' => bcrypt('admin')]);
     $user->isAdmin = 1;
     $user->save();
     \File::makeDirectory(public_path() . "/content/admin");
     \File::makeDirectory(public_path() . "/content/admin/photos/");
     $dest = public_path() . "/content/admin/photos/profile.png";
     $file = public_path() . "/img/profile.png";
     \File::copy($file, $dest);
     UserInfo::create(["user_id" => $user->id, "photo" => "/content/admin/photos/profile.png"]);
     //init Payment
     Payment::create(['stripe_publishable_key' => '', 'stripe_secret_key' => '', 'paypal_client_id' => '', 'paypal_secret' => '']);
 }
예제 #5
0
 public function registerUser($payload)
 {
     $email = $payload['email'];
     $password = $payload['password'];
     \DB::beginTransaction();
     try {
         $user = User::create(['name' => User::LOCAL_NEW_USER, 'is_third' => User::THIRD_FALSE, 'email' => $email, 'password' => bcrypt($password)]);
         UserInfo::create(['user_id' => $user->id, 'nickname' => 'New User', 'icon_url' => 'http://s33.postimg.org/hv2ari8a7/1464809650_unknown.png']);
         \DB::commit();
         return array('result' => true, 'content' => $user);
     } catch (\Exception $e) {
         \DB::rollBack();
         return array('result' => false, 'message' => "Create new user failed!");
     }
 }
예제 #6
0
    public function run()
    {		
        UserInfo::truncate();
				UserInfo::create(['company_name' => 'Dell',
        			'company_address1' => 'T Nagar',
       				'company_address2' => 'New York',
       				'city' => 'Melbourne',
       				'state' => 'Dubai',
      				'country' => 'USA',
       				'pin' => '4213456',
       				'phone' => '7234556',
              'description' => 'Lifes easy',
       				'user_id' => 1
              ]);
				UserInfo::create(['company_name' => '123',
        			'company_address1' => 'T Nagar',
       				'company_address2' => 'New York',
       				'city' => 'Melbourne',
       				'state' => 'Dubai',
      				'country' => 'USA',
       				'pin' => '4213456',
       				'phone' => '7234556',
       				'description' => 'Lifes easy',

              'user_id' => 2]);
				UserInfo::create(['company_name' => 'Dell',
        			'company_address1' => 'T Nagar',
       				'company_address2' => 'New York',
       				'city' => 'Melbourne',
       				'state' => 'Dubai',
      				'country' => 'USA',
       				'pin' => '4213456',
       				'phone' => '7234556',
       				'description' => 'Lifes easy',

              'user_id' => 3]);
				
    }
예제 #7
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     $id = $user->id;
     $c261 = null;
     $c262 = null;
     $c306 = null;
     $c406 = null;
     if (!empty($data['csci_261'])) {
         $c261 = 'CSCI 261';
     }
     if (!empty($data['csci_262'])) {
         $c262 = 'CSCI 262';
     }
     if (!empty($data['csci_306'])) {
         $c306 = 'CSCI 306';
     }
     if (!empty($data['csci_406'])) {
         $c406 = 'CSCI 406';
     }
     UserInfo::create(['user_id' => $id, 'style' => $data['style'], 'lang_one' => $data['lang_one'], 'lang_two' => $data['lang_two'], 'lang_three' => $data['lang_three'], 'csci_261' => $c261, 'csci_262' => $c262, 'csci_306' => $c306, 'csci_406' => $c406]);
     return $user;
 }
예제 #8
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     UserInfo::create(['user_id' => $user->id, 'tanggal_lahir' => $data['tanggal_lahir'], 'alamat' => $data['alamat'], 'jenis_kelamin' => $data['jenis_kelamin']]);
     return $user;
 }