Try below code
@foreach($users as $user)
{{$user->first()->last_name}},{{$user->first()->first_name}},{{$user->first()->middle_name}}
@endforeach
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When I dd($users) I get some data.
Collection {#336 ▼
#items: array:1 [▼
0 => User {#330 ▼
#fillable: array:11 [▶]
#hidden: array:2 [▶]
#connection: "mysql"
#table: "users"
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#attributes: array:21 [▶]
#original: array:21 [▼
"id" => 1
"first_name" => "Jerome"
"last_name" => "Villaver"
"middle_name" => "Llacuna"
"achievement_id" => null
"country_id" => 1
"provider" => "system"
"avatar" => "avatar.png"
"avatar_url" => null
"email" => "[email protected]"
"status" => 0
"email_verified_at" => null
"password" => "ykyU8Rcw3ZroKD2UV3r.0uj.Yilar30EMTyZ5PvOd.IT6WEwYoZ4q"
"remember_token" => null
"availabity" => null
"address" => null
"educaction_id" => null
"notes" => null
"rating_id" => null
"created_at" => "2019-02-18 00:44:59"
"updated_at" => "2019-02-18 00:44:59"
]
and my view is something like this
@foreach($users as $user)
Please or to participate in this conversation.