Support the ongoing development of Laravel.io →
Requests Eloquent Views
Last updated 2 years ago.
0

This way you make $data an array where every entry is a seperate part of your comment logic. You have an entry with all the usernames, and one with all the imgs. But instead you want an array where every entry is a seperate comment, with its own username and img.

So instead of doing:

$data[img][] = 'img location'; $data[username][] = 'username';

You need to do

$entry = array(); $entry[img] = 'img location'; $entry[username] = 'username'; $data[] = $entry;

I hope this makes sense to you.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

alenn-m alenn-m Joined 5 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.