matters() public method

public matters ( )
Exemplo n.º 1
0
 /**
  * Associate matters.
  * @param  Classroom $classroom
  * @param  array     $matters
  */
 public function associateMatters(Classroom $classroom, array $matters)
 {
     $ids = [];
     foreach ($matters['matters'] as $matter) {
         $ids[] = $matter['id'];
     }
     $classroom->matters()->sync($ids);
 }