$aComments = DB::table('Comments')
->where('Name', $name)
->get()
->toArray();
foreach ($aComments as $comment) {
dd(gettype($aJoinCommentUser), gettype($comment));
}
->get()
->toArray()
The toArray method converts the collection into a plain PHP array. If the collection's values are Eloquent models, the models will also be converted to arrays
The get method returns an Illuminate\Support\Collection instance containing the results of the query where each result is an instance of the PHP stdClass object.
$aComments = Comment::where('Name', $name)
->get()
->toArray();