I am trying to use more than one array in a @foreach. After looking at SO I saw this is not what @foreach is for so what should I use in the following scenario? This is fake data I'm using to mock up the site before handing it to the back end devs. I am using Laravel and am a beginner in PHP so I am at your mercy.
Array
$messageData['conversation_sender'][0][0] = 'Clint Smith';
$messageData['conversation_sender'][0][1] = 'Tom Corwin';
$messageData['conversation_sender'][0][2] = 'John Michaels';
$messageData['conversation_sender'][0][3] = 'Jane Winnipeg';
$messageData['conversation_class'][0][0] = 'owner-comment';
$messageData['conversation_class'][0][1] = 'friend-comment';
$messageData['conversation_class'][0][2] = 'friend-comment';
$messageData['conversation_class'][0][3] = 'friend-comment';
$messageData['conversation_message'][0][0] = 'Hello!';
$messageData['conversation_message'][0][1] = 'Can\t wait to catch up';
$messageData['conversation_message'][0][2] = 'Whoop, whoop';
$messageData['conversation_message'][0][3] = 'Good times!';
$messageData['conversation_time'][0][0] = '2 minutes ago';
$messageData['conversation_time'][0][1] = '4 minutes ago';
$messageData['conversation_time'][0][2] = '8 minutes ago';
$messageData['conversation_time'][0][3] = '18 minutes ago';
Example of @foreach loop I have been using, for one array at a time
@foreach($messageData['conversation_sender'][0] as $value)
<span class="form-tag">{{ $value }} <i class="fa fa-plus"></i></span>
@endforeach
How I'd like to use it(I know I'm dreaming)
@for($messageData['conversation_sender'][0] as $sender, $messageData['conversation_class'][0] as $class, $messageData['conversation_message'][0] as $message, $messageData['conversation_time'][0] as $time)
<li class="{{ $class }} clearfix">
<p class="text-left">
<strong>{{ $sender }}</strong><br>
{{ $message }}
</p>
<span class="message-created text-muted">{{ $time }}</span>
</li>
@endfor
Example of what the first iteration should print out
<li class="owner-comment clearfix">
<p class="text-left">
<strong>Clint Smith</strong><br>
Hello!
</p>
<span class="message-created text-muted">2 minutes ago</span>
</li>
@before everything? In PHP,@is for suppressing error messages.