我需要在laravel 4上使用变量到一个方法,如何将这个变量传递给来自eloquent的方法块?
$variableonmethod=array('value1','value2');
PreAlumno::chunk(200, function($prealumnos) {
foreach ($prealumnos as $pre) {
//do something with variableonmethod
}
});
Run Code Online (Sandbox Code Playgroud)