Ejemplo n.º 1
0
 private function groupTable()
 {
     Group::truncate();
     $data = [['title' => 'Администратор', 'system' => true], ['title' => 'Пользователь', 'system' => false]];
     foreach ($data as $v) {
         Group::create($v);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     Video::truncate();
     $this->call(VideosTableSeeder::class);
     User::truncate();
     $this->call(UsersTableSeeder::class);
     Analyse::truncate();
     $this->call(AnalyseTableSeeder::class);
     Group::truncate();
     $this->call(GroupsTableSeeder::class);
     Sport::truncate();
     $this->call(SportsTableSeeder::class);
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
Ejemplo n.º 3
0
 public function run()
 {
     Group::truncate();
     User::truncate();
     /* Admin */
     $adminGroup = Group::forceCreate(['name' => 'Admin', 'permissions' => ['users.manage' => true, 'groups.manage' => true, 'organisations.access' => true], 'description' => 'Administrator group']);
     /* Manager */
     $managerGroup = Group::forceCreate(['name' => 'Manager', 'permissions' => ['organisation.*' => true], 'description' => 'Manager for an organisation']);
     /* Counselor */
     Group::forceCreate(['name' => 'Counselor', 'permissions' => ['organisation.counselor.edit' => true], 'description' => 'Counselor for an organisation']);
     /* Author */
     Group::forceCreate(['name' => 'Author', 'permissions' => ['articles.*' => true], 'description' => 'Creates and edit articles individual articles or for an organisation']);
     /* User */
     $userGroup = Group::forceCreate(['name' => 'User', 'permissions' => ['account.manage' => true], 'description' => 'Default user group', 'is_new_user_default' => true]);
     $admin = User::forceCreate(['email' => '*****@*****.**', 'username' => 'petross', 'password' => '@minaks', 'first_name' => 'Simon', 'last_name' => 'Petross', 'activated' => true, 'permissions' => ['superuser' => true]]);
     $manager = User::forceCreate(['email' => '*****@*****.**', 'username' => 'simon', 'password' => 'minads', 'first_name' => 'Petross', 'last_name' => 'Simon', 'activated' => true]);
     $userGroup->addAllUsersToGroup();
     $admin->addGroup($adminGroup);
     $manager->addGroup($managerGroup);
 }