Я начал использовать шаблонный движок Blade с codeigniter, а в Google Api я использую blade-сервер для разработки старого проекта, созданного другими разработчиками, по этой причине мне нужно сохранить ту же структуру данных Blade.
это Bladeкод, написанный другими разработчиками (мне нужно сохранить его):
@foreach ($analytics['countries'] as $country)
['{{$country['country']}}', {{$country['visits_percent']}}],
@endforeach
это мой код PHP
$this->blade->view()->make('analytics/analytics', ['analytics' => $analytics]);
и это мой массив $ analtics:
Array
(
[0] => Array
(
[0] => Canada
[1] => 3367
)
[1] => Array
(
[0] => United States
[1] => 202
)
[2] => Array
(
[0] => Malaysia
[1] => 34
)
[3] => Array
(
[0] => Mexico
[1] => 31
)
[4] => Array
(
[0] => Peru
[1] => 23
)
[5] => Array
(
[0] => Brazil
[1] => 21
)
[6] => Array
(
[0] => United Kingdom
[1] => 21
)
[7] => Array
(
[0] => Netherlands
[1] => 17
)
[8] => Array
(
[0] => Nepal
[1] => 14
)
[9] => Array
(
[0] => India
[1] => 12
)
[10] => Array
(
[0] => Belarus
[1] => 11
)
[11] => Array
(
[0] => France
[1] => 9
)
[12] => Array
(
[0] => Ireland
[1] => 9
)
[13] => Array
(
[0] => Germany
[1] => 7
)
[14] => Array
(
[0] => Philippines
[1] => 6
)
[15] => Array
(
[0] => Singapore
[1] => 5
)
[16] => Array
(
[0] => Bangladesh
[1] => 4
)
[17] => Array
(
[0] => Italy
[1] => 4
)
[18] => Array
(
[0] => Serbia
[1] => 4
)
[19] => Array
(
[0] => Australia
[1] => 3
)
[20] => Array
(
[0] => Belgium
[1] => 3
)
[21] => Array
(
[0] => Indonesia
[1] => 3
)
[22] => Array
(
[0] => Iran
[1] => 3
)
[23] => Array
(
[0] => Jordan
[1] => 3
)
[24] => Array
(
[0] => Morocco
[1] => 3
)
[25] => Array
(
[0] => China
[1] => 2
)
[26] => Array
(
[0] => Colombia
[1] => 2
)
[27] => Array
(
[0] => Moldova
[1] => 2
)
[28] => Array
(
[0] => Pakistan
[1] => 2
)
[29] => Array
(
[0] => Poland
[1] => 2
)
[30] => Array
(
[0] => Romania
[1] => 2
)
[31] => Array
(
[0] => South Africa
[1] => 2
)
[32] => Array
(
[0] => Thailand
[1] => 2
)
[33] => Array
(
[0] => Turkey
[1] => 2
)
[34] => Array
(
[0] => Argentina
[1] => 1
)
[35] => Array
(
[0] => El Salvador
[1] => 1
)
[36] => Array
(
[0] => Hong Kong
[1] => 1
)
[37] => Array
(
[0] => Japan
[1] => 1
)
[38] => Array
(
[0] => Kenya
[1] => 1
)
[39] => Array
(
[0] => Latvia
[1] => 1
)
[40] => Array
(
[0] => New Zealand
[1] => 1
)
[41] => Array
(
[0] => Russia
[1] => 1
)
[42] => Array
(
[0] => Saudi Arabia
[1] => 1
)
[43] => Array
(
[0] => South Korea
[1] => 1
)
)
У меня вопрос, как я могу создать такую же структуру массива для блейда, спасибо