I vaguely remember there being a PHP or Laravel helper function that collects variables into a named array, using the variable names as the array keys.
What was the name of that function again?
With
$foo = 1;
$bar = 2;
this call
some_function($foo, $bar);
would return
[
"foo" => 1,
"bar" => 2
]
Use
compact()
: