예제 #1
0
 /**
  * Seed the project teams table.
  */
 protected function seedOwners()
 {
     $defaultOwners = [['name' => 'Baidu', 'path' => 'Baidu', 'user_id' => 1, 'description' => 'www.baidu.com', 'type' => 'Group'], ['name' => 'Alibaba', 'path' => 'Alibaba', 'user_id' => 1, 'description' => 'www.alibaba.com', 'type' => 'Group'], ['name' => 'Tencent', 'path' => 'Tencent', 'user_id' => 1, 'description' => 'www.qq.com', 'type' => 'Group'], ['name' => 'demo', 'path' => 'demo', 'user_id' => 1, 'description' => 'user', 'type' => 'User'], ['name' => 'jack', 'path' => 'jack', 'user_id' => 2, 'description' => 'user', 'type' => 'User'], ['name' => 'larry', 'path' => 'larry', 'user_id' => 3, 'description' => 'user', 'type' => 'User']];
     foreach ($defaultOwners as $owner) {
         Owner::create($owner);
     }
 }
예제 #2
0
 /**
  * Handle the add project owner command.
  *
  * @param \Gitamin\Commands\Owner\AddOwnerCommand $command
  *
  * @return \Gitamin\Models\Owner
  */
 public function handle(AddOwnerCommand $command)
 {
     $group = Owner::create(['name' => $command->name, 'path' => $command->path, 'user_id' => $command->user_id, 'description' => $command->description, 'type' => $command->type]);
     event(new OwnerWasAddedEvent($group));
     return $group;
 }