I had a problem with passing a variable to close the request, here is my code:
function get_usersbyname($name){ dd($name); $resultset = DB::table('users')->where(function($query){ $query->where('username', 'LIKE', $name); }); .... }
if I run it, it returns the error " undefined name variable ", but I already passed the variable $name and checked its existence. Also, I cannot find any resource that explains how to pass a variable to an anonymous request function. Could you help me with this problem?
petwho
source share