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

when you do a where()->get() it returns a Collection . you would simply have to loop through it. To get just one item do a where()->first()

0

@AtomicRSA,

Hi.. why don't you do this :

$data=$transac->toArray();

and then pass the $data to your view.. seems like it shall work, if you convert it to array first.

regards

0

@astroanu - Thanks for your reply, I do actually need to display data from all the arrays and I am looping through it with the last part of my post but there is nothing:( @vidihermes - Thanks for your reply also, I will try and see if it works.

0

I could access the value by simply using this in my view

@foreach($transac as $info)
                            <tr>
                                 <th>
                                    {{ $info->sale->amount }}
                                </th>
                                
                            </tr>
                        </thead>
                        @endforeach

Thanks for all your help.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

AtomicRSA atomicrsa Joined 24 Jun 2015

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.