/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     User::truncate();
     Staff::truncate();
     Student::truncate();
     StudentNumber::truncate();
     StaffNumber::truncate();
     $user = ['first_name' => 'Jose Antonio', 'last_name' => 'Sinadinse', 'fullname' => '', 'password' => \Hash::make('password'), 'email' => '*****@*****.**', 'address' => 'Pretoria', 'cellnumber' => '000000000', 'user_type_id' => 1, 'state_id' => 1];
     if (StaffNumber::all()->count() == 0) {
         $stfnum = StaffNumber::create(["number" => 2000, "date" => date("Y-m-d")]);
     } else {
         $lateststfnum = StaffNumber::all()->last();
         $stfnum = StaffNumber::create(["number" => $lateststfnum->number + 1, "date" => date("Y-m-d")]);
     }
     $staff = Staff::create(['staff_number' => $stfnum->number]);
     $user = $staff->user()->create($user);
     $user->addPermission('admin');
     for ($i = 3; $i < 20; $i++) {
         $user = ['first_name' => 'Name' . $i, 'last_name' => 'Surname' . $i, 'fullname' => '', 'password' => \Hash::make('aleluia'), 'email' => 'josebarros' . $i . '@hotmail.com', 'address' => 'Pretoria', 'cellnumber' => '00000000' . $i, 'user_type_id' => 3, 'state_id' => 1];
         if (StudentNumber::all()->count() == 0) {
             $stdnum = StudentNumber::create(["number" => 200000000, "date" => date("Y-m-d")]);
         } else {
             $lateststdnum = StudentNumber::all()->last();
             $stdnum = StudentNumber::create(["number" => $lateststdnum->number + 1, "date" => date("Y-m-d")]);
         }
         $student = Student::create(['student_number' => $stdnum->number, "university_id" => 1, "faculty_id" => '', "department_id" => '', "course_id" => '']);
         $user = $student->user()->create($user);
         $user->addPermission('student');
     }
 }
 public function seed()
 {
     User::truncate();
     User::create(['name' => 'Admin', 'email' => '*****@*****.**', 'password' => bcrypt('password')]);
     User::create(['name' => 'User', 'email' => '*****@*****.**', 'password' => bcrypt('password')]);
     User::create(['name' => 'New', 'email' => '*****@*****.**', 'password' => bcrypt('password')]);
     Package::create(['name' => 'BriansDBMT', 'namespace' => 'TomButts-BriansDBMT-Migrate', 'version' => 'dev-master']);
 }
Пример #3
0
 public function run()
 {
     DB::statement("SET foreign_key_checks = 0");
     User::truncate();
     $adminRole = Role::whereName('administrator')->first();
     $userRole = Role::whereName('user')->first();
     $user = User::create(array('first_name' => 'Suchay', 'last_name' => 'Janbandhu', 'email' => '*****@*****.**', 'password' => Hash::make('password'), 'confirmed' => 1));
     $user->assignRole($adminRole);
     $user = User::create(array('first_name' => 'Viplove', 'last_name' => 'Wahane', 'email' => '*****@*****.**', 'password' => Hash::make('password'), 'confirmed' => 1));
     $user->assignRole($userRole);
 }
Пример #4
0
 function run()
 {
     User::truncate();
     foreach (range(1, 30) as $n) {
         $User = new User();
         $User->id = $n;
         $User->email = 'user' . $n . '@test.com';
         $User->password = '******';
         $User->save();
     }
 }
Пример #5
0
 public function run()
 {
     User::truncate();
     // Random Password
     //$password = str_random(8);
     $password = '******';
     User::create(['username' => 'nuwira', 'name' => 'Nuwira', 'email' => '*****@*****.**', 'password' => Hash::make($password), 'is_active' => 1]);
     $this->command->info('');
     $this->command->comment(' Username : nuwira');
     $this->command->comment(' Password : '******'');
 }
Пример #6
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS=0');
     User::truncate();
     Role::truncate();
     Permission::truncate();
     DB::statement('SET FOREIGN_KEY_CHECKS=1');
     Model::unguard();
     $this->call(UserTableSeeder::class);
     $this->call(RolesTableSeeder::class);
     $this->call(PermissionsTableSeeder::class);
     Model::reguard();
 }
Пример #7
0
 public function run()
 {
     User::truncate();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 10; $i++) {
         try {
             // Create the user
             $user = Sentry::createUser(array('first_name' => $faker->name, 'last_name' => $faker->name, 'email' => $faker->unique()->email, 'phone' => $faker->unique()->phoneNumber, 'image_url' => $faker->imageUrl($width = 640, $height = 480), 'password' => '123', 'activated' => true));
             // Find the group using the group id
             $adminGroup = Sentry::findGroupById($faker->randomElement(array(1, 2, 3)));
             // Assign the group to the user
             $user->addGroup($adminGroup);
         } catch (\Exception $e) {
         }
     }
 }
Пример #8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement("SET FOREIGN_KEY_CHECKS = 0");
     User::truncate();
     $fileName = '2016-02-24-users';
     $table_name = 'users';
     $fullFile = 'database/seeds/main/csv/' . $fileName . '.csv';
     $query = sprintf("LOAD DATA local INFILE '%s' INTO TABLE {$table_name} FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\"' LINES TERMINATED BY '\\n'", addslashes($fullFile));
     DB::connection()->getPdo()->exec($query);
     // DB::connection('common')->statement("TRUNCATE user_has_roles");
     // $fileName = '2016-02-17-user-has-roles';
     // $fullFile = 'database/seeds/common/csv/'.$fileName.'.csv';
     // $query = sprintf("LOAD DATA local INFILE '%s' INTO TABLE common.user_has_roles FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\"' LINES TERMINATED BY '\\n'", addslashes($fullFile));
     // DB::connection('common')->getpdo()->exec($query);
     DB::statement("SET FOREIGN_KEY_CHECKS = 1");
 }
Пример #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call('UserTableSeeder');
     User::truncate();
     App\Models\Article::truncate();
     // App\Models\Category::truncate();
     // factory(User::class, 47)->create()->each(function($u) {
     // $n = rand(1,30);
     // // dd($u);
     // $u->articles()->save(factory(App\Models\Article::class, $n)->make());
     // });
     $users = factory(App\Models\User::class, 13)->create()->each(function ($u) {
         $n = rand(1, 30);
         for ($i = 1; $i < $n; $i++) {
             $u->articles()->save(factory(App\Models\Article::class)->make());
         }
     });
     // factory(App\Models\Article::class, 54)->create();
     factory(App\Models\Category::class, 20)->create();
     // factory(App\Mo/usdels\Comment::class, 98)->create();
     // factory(App\Models\Notification::class, 12)->create();
     Model::reguard();
 }
Пример #10
0
 public function run()
 {
     User::truncate();
     factory(User::class)->create(['name' => 'Eruza MSP', 'email' => '*****@*****.**', 'password' => bcrypt('eruza@msp')]);
     factory(User::class, 0)->create();
 }
Пример #11
0
 protected function clearDatabasesForScenario()
 {
     \App\Models\Block::truncate();
     \App\Models\Transaction::truncate();
     \App\Models\Notification::truncate();
     \App\Models\MonitoredAddress::truncate();
     \App\Models\PaymentAddress::truncate();
     \App\Models\Send::truncate();
     \App\Models\User::truncate();
     \App\Models\Account::truncate();
     \App\Models\APICall::truncate();
     \App\Models\LedgerEntry::truncate();
     return;
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     User::truncate();
     factory(User::class, 100)->create();
 }
Пример #13
0
 protected function migrate_user()
 {
     $old_collection = 'users';
     $new_collection = 'v2_users';
     $website = Website::first();
     // get old articles
     User::truncate();
     DB::connection('mysql')->table('works')->truncate();
     DB::connection('mongodb')->collection($old_collection)->chunk(1000, function ($data) use($new_collection, $website) {
         foreach ($data as $x) {
             $user = new User(['name' => isset($x['name']) ? $x['name'] : $x['username'], 'username' => $x['username'], 'email' => isset($x['email']) ? $x['email'] : '', 'password' => \Hash::make('123123')]);
             if ($user->save()) {
                 $user->works()->attach($website, ['start_at' => \Carbon\Carbon::now(), 'end_at' => null, 'role' => 'writer']);
             }
         }
     });
     $user = new User(['name' => "Erick Mo", 'username' => "erickmo", 'email' => "*****@*****.**", 'password' => \Hash::make('123123')]);
     if ($user->save()) {
         $user->works()->attach($website, ['start_at' => \Carbon\Carbon::now(), 'end_at' => null, 'role' => 'super']);
     }
 }
Пример #14
0
 public function deleteAll()
 {
     return User::truncate();
 }