Use the use
keyword to bind variables into the function’s scope.
function() use ($db) {
Closures may also inherit variables from the parent scope. Any such variables must be declared in the function header [using
use
].
Use the use
keyword to bind variables into the function’s scope.
function() use ($db) {
Closures may also inherit variables from the parent scope. Any such variables must be declared in the function header [using
use
].