public function runBoards()
 {
     $this->command->comment("\tInserting board owner roles.");
     $boardRole = $this->slugs()[Role::ID_OWNER];
     foreach (Board::get() as $board) {
         $roleModel = Role::updateOrCreate(['role' => $boardRole['role'], 'board_uri' => $board->board_uri, 'caste' => $boardRole['caste']], ['name' => $boardRole['name'], 'capcode' => $boardRole['capcode'], 'inherit_id' => Role::ID_OWNER, 'system' => false, 'weight' => $boardRole['weight'] + 5]);
     }
 }
 public function run()
 {
     $this->command->info('Seeding roles.');
     foreach ($this->slugs() as $slug) {
         Role::updateOrCreate(['role_id' => $slug['role_id']], $slug);
     }
     foreach (Board::get() as $board) {
         $boardRole = $this->slugs()[Role::ID_OWNER];
         $roleModel = Role::updateOrCreate(['role' => $boardRole['role'], 'board_uri' => $board->board_uri, 'caste' => $boardRole['caste']], ['name' => $boardRole['name'], 'capcode' => $boardRole['capcode'], 'inherit_id' => Role::ID_OWNER, 'system' => false, 'weight' => $boardRole['weight'] + 5]);
     }
 }
 public function run()
 {
     $this->command->info('Seeding roles.');
     foreach ($this->slugs() as $slug) {
         Role::updateOrCreate(['role_id' => $slug['role_id']], $slug);
     }
     foreach (Board::get() as $board) {
         $boardRole = $this->slugs()[Role::ID_OWNER];
         $boardRole['board_uri'] = $board->board_uri;
         $boardRole['system'] = $board->board_uri;
         $boardRole['inherit_id'] = Role::ID_OWNER;
         $boardRole['weight'] += 5;
         unset($boardRole['role_id']);
         Role::updateOrCreate(['role' => $boardRole['role'], 'board_uri' => $boardRole['board_uri'], 'caste' => $boardRole['caste']], $boardRole);
     }
 }
Beispiel #4
0
 public function run()
 {
     $this->command->info('Seeding roles.');
     foreach ($this->slugs() as $slug) {
         Role::updateOrCreate(['role_id' => $slug['role_id'], 'role' => $slug['role'], 'board_uri' => $slug['board_uri'], 'caste' => $slug['caste']], $slug);
     }
     foreach (Board::get() as $board) {
         $boardRole = ['role' => "owner", 'board_uri' => $board->board_uri, 'caste' => NULL, 'inherit_id' => Role::$ROLE_OWNER, 'name' => "Board Owner", 'capcode' => "Board Owner", 'system' => false];
         Role::updateOrCreate(['role' => $boardRole['role'], 'board_uri' => $boardRole['board_uri'], 'caste' => $boardRole['caste']], $boardRole);
     }
 }