protected function modules(Course $course) {
        $modules = $course->modules()->active()->get();
        $sortedModules = $modules->sortBy(
            function ($module, $key) {
                return $module->order;
            }
        );
        return $this->validateCollection($sortedModules);
    }
protected function modules(Course $course) {
        $modules = $course->modules()->active()->get();
        $sortedModules = $modules->sortBy(
            function ($module, $key) {
                return $module->order;
            }
        );
        return $this->validateCollection($sortedModules);
    }
protected function modules ( Course $ course ) { $ modules = $ course -> modules ( ) -> active ( ) -> get ( ) ; $ sortedModules = $ modules -> sortBy ( function ( $ module , $ key ) { return $ module -> order ; } ) ; return $ this -> validateCollection ( $ sortedModules ) ; }
Get the modules to migrate.

@param Course $course
@return \Illuminate\Database\Eloquent\Collection|static[]
Get the modules to migrate .