Edit a multidimensional array?

Good night, all. Second day struggling with the task.
A dynamic form
Fields are added dynamically, for clarity, below I have a diagram of the possible forms
${id} - $cinema->id
<form method="POST">
 @foreach($ticket as $cinema)
Cinema
@foreach(sessions)
 <input type="text" name="cinema[${id}][date_start][]">
 <input type="text" name="cinema[${id}][price][]">
@endforeach
@endforeach
 <input type="submit">
</form>

You need to add the key cinema_id in the array
In order to understand how many sessions and at what movie theater it is necessary to add them.
In the end I need to like this:
0 => [
 'cinema_id' => 24,
 'date_start' => 0,
 'price' => 100,
],
1 => [
 'cinema_id' => 23,
 'date_start' => 0,
 'price' => 150,
],
2 => [
 'cinema_id' => 23,
 'date_start' => 0,
 'price' => 140,
]

After that, use a loop to add 3 sessions, with the specified parameters.

Database structure:
movie_id | cinema_id | date_start | price

If who faced with similar or knows the solution to the problem please help, thanks in advance for your help.
July 8th 19 at 12:16
1 answer
July 8th 19 at 12:18
Solution
$cinemas = $request->cinema;
$cinemas = collect($ticket)->map(function($item, $key){
 $item['cinema_id'] = $key;
 return $item;
})->toArray();
dd($ticket);

Find more questions by tags ArraysLaravelPHP