zaster
5 months ago
591
4
General

Saving Additional Data On A Pivot Table (Multiple Entries)

Posted 5 months ago by zaster

I am unable to insert $sub_job_qtys and $sub_job_description

1366 Incorrect integer value: '[1,1]' for column 'qty' at row 1
$sub_job_ids = $job->sub_jobs->pluck('id');
$sub_job_qtys = $job->sub_jobs->pluck('qty');
$sub_job_descriptions = $job->sub_jobs->pluck('description');


$dispatch->sub_jobs()->attach($sub_job_ids, ['qty' => $sub_job_qtys, 'description' => $sub_job_descriptions]);

Please sign in or create an account to participate in this conversation.