How can I add more items in the "items" array? I have a table with several items and I want to run a foreach inside to load each one of them, but when I do it I throw an error (syntax error, unexpected 'foreach'). The project is done in Laravel 5.5
$preferenceData = array(
"items" => array(
array(
"id" => "Code",
"title" => "Title of what you are paying for",
"currency_id" => "ARS",
"picture_url" =>"img/logomp3.gif",
"description" => "Description",
"category_id" => "Category",
"quantity" => 1,
"unit_price" => 1.0
),
),
),