- What error?
check_detail looks like an array/Collection, so you would use first on it.
{{ $data->check_detail->first()->apps_type }}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
I'm new with eloquent realationship, what i'm doing is having 3 database tables and i success get all data. I'm joining database table 'work' with 'wallet' and 'appsData', but i'm facing problem that how to show these data in view.
[{"game_id":"1001","check_wallet":[{"id":355,"wallet":"20314","game_id":"1001","status":0,"warning":0,"create_user":"WENDY","edit_user":null,"delete_user":null,"created_at":"2018-06-01 08:53:07","edited_at":"2018-06-01 08:53:07","check_detail":[{"id":1228,"wallet_id":"20314","apps_type":"whatsapp","prev_apps_id":null,"apps_id":"abc","type":null,"remarks":null,"status":0,"created_at":"2018-06-01 08:53:07","created_user":"WENDY"}]}]}
I need to show "apps_type", i have try echo it with {{ $data->check_detail->apps_type }} But it comes out error, what is the correct syntax to select this value in array? Thanks
check_detail looks like an array/Collection, so you would use first on it.
{{ $data->check_detail->first()->apps_type }}
Please or to participate in this conversation.