does someone can help me to show me how can I make a loop if my object is just like this assigned: "["741852963","79545236","7845120"]"
I try with
$assigned = array();
foreach($project->assigned as $arrayItem){
$user = Admin::select('name', 'numero_empleado')->where('numero_empleado', $arrayItem)->get();
$assigned = $user;
}
return $assigned;
but that way throw me an error
"Invalid argument supplied for foreach()"
I want to add the result in other array to send to the front
$project->assignedlooks like a string representation of an array... Which is not valid in aforeach()loop. Rundd(is_string($project->assigned));; if that saystrue, then that's your issue.