Exemplo n.º 1
0
 /**
  * Sync a user with new repositories.
  *
  * @param \App\Models\User\User          $user
  * @param \Illuminate\Support\Collection $repositories
  *
  * @return void
  */
 public function sync(User $user, Collection $repositories)
 {
     $existing = $user->repositories;
     $repositories = $this->map($repositories);
     $repositories = $this->create($repositories, $existing);
     $user->repositories()->saveMany($repositories);
 }