Van1310
203
6
Laravel

Cannot use a scalar value as an array

Posted 2 months ago by Van1310

$insert=Import::pluck('Amount_Grand_Total')->toArray();

for($i=0;$i<count($insert);$i++)

{

$update[]=$insert[$i];

$half_amount[]=$update[$i]/2;

$half_amount=DB::table('imports')->update(['Half_Amount'=>$request->get('Half_Amount')]);

}

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

Reply to

Use Markdown with GitHub-flavored code blocks.