Level 3
Sep 14, 2016
1
Level 3
Sent arguments to Job
I am working with jobs currently to speed up my panel.
I am trying to create a simple job to handle the API call, in the job I have a curl setup that takes a table in form of arguments to handle.
Error: Missing argument 1 for App\Jobs\runAPI::handle()
Controller sends this:
$args = [
"action" => "action",
"action2" => "action2",
];
dispatch(new runAPI($args)); <--- This has the argument for the call.
The job has this, obviously it has more than this but thats beyond whats needed.
public function handle($args)
{
foreach ($args as $key => $value) {
# take all arguments from the call, and convert to something the API can understand.
$postfields[$key] = $value;
}
}
For some reason the arguments, are not sent when i dispatch the job.
Please or to participate in this conversation.