I try to manipulate a Collection based on a request include in a foreach .. As an ouput i receive a Collection with an array of object ...
What i need is a Collection of array witch contain my attributes ... This is what i have with a dd($users) :
Collection {#551 ▼
#items: array:16 [▼
0 => User {#610 ▼
#table: "users"
#fillable: array:13 [▶]
#guarded: array:1 [▶]
#hidden: array:2 [▶]
#timestamp: true
#softDelete: true
#attributes: array:15 [▼
"id" => 1
"ua_id" => 351
"grade_id" => 584
"metier_id" => 18
"nom" => "xxxx"
"prenom" => "xxxx"
"matricule" => "xxxx"
"email" => null
"datenaissance" => "xxxx"
"password" => "xxxxx"
...
And this is what i want :
Collection {#2114 ▼
#items: array:16 [▼
1 => array:15 [▼
"id" => 1
"ua_id" => 351
"grade_id" => 584
"metier_id" => 18
"nom" => "xxxx"
"prenom" => "xxxx"
"matricule" => "xxxx"
"email" => null
"datenaissance" => "xxxx"
"password" => "xxxxx"
...