public function run()
 {
     if (App::environment() === 'production') {
         exit('Seed should be run only in development/debug environment.');
     }
     DB::statement('SET FOREIGN_KEY_CHECKS=0');
     DB::table('users')->truncate();
     $user = User::create(['organization_id' => 1, 'email' => '*****@*****.**', 'password' => 'password', 'firstname' => 'Root', 'lastname' => 'User', 'active' => 1]);
     $user = User::create(['organization_id' => 2, 'email' => '*****@*****.**', 'password' => 'password', 'firstname' => 'Admin', 'lastname' => 'User', 'active' => 1]);
     $user = User::create(['organization_id' => 2, 'email' => '*****@*****.**', 'password' => 'password', 'firstname' => 'Moderator1', 'lastname' => 'User', 'active' => 1]);
     $user = User::create(['organization_id' => 3, 'email' => '*****@*****.**', 'password' => 'password', 'firstname' => 'Moderator2', 'lastname' => 'User', 'active' => 1]);
     $user = User::create(['organization_id' => 4, 'email' => '*****@*****.**', 'password' => 'password', 'firstname' => 'Moderator3', 'lastname' => 'User', 'active' => 1]);
     DB::statement('SET FOREIGN_KEY_CHECKS=1');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     if (App::environment() === 'production') {
         exit('Seed should be run only in development/debug environment.');
     }
     DB::statement('SET FOREIGN_KEY_CHECKS=0');
     DB::table('permission_user')->truncate();
     $partnerAdmin = User::where('email', '*****@*****.**')->first();
     $partnerAdmin->assignPermission('users');
     $partnerAdmin->assignPermission('events');
     $partnerAdmin->assignPermission('organizations');
     $partnerAdmin->assignPermission('attendees');
     $partnerAdmin = User::where('email', '*****@*****.**')->first();
     $partnerAdmin->assignPermission('users');
     $partnerAdmin->assignPermission('attendees');
     DB::statement('SET FOREIGN_KEY_CHECKS=1');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     if (App::environment() === 'production') {
         exit('Seed should be run only in development/debug environment.');
     }
     DB::statement('SET FOREIGN_KEY_CHECKS=0');
     DB::table('role_user')->truncate();
     // Root user
     $user = User::find(1);
     $user->assignRole('owner');
     $user = User::find(2);
     $user->assignRole('admin');
     $user = User::find(3);
     $user->assignRole('admin');
     $user = User::find(4);
     $user->assignRole('moderator');
     $user = User::find(5);
     $user->assignRole('moderator');
     DB::statement('SET FOREIGN_KEY_CHECKS=1');
 }
 public function testRootUserParentOrganization()
 {
     $user = User::find(1);
     $parentOrganization = Organization::find(1);
     $this->assertEquals($user->getParentOrganization()->id, $parentOrganization->id);
 }