1
I created a function in the controller that returns the users where the user condition is 1.
Currently it is returning in json all the data of this user.
How can I return only user emails?
I tried something like:
public function avisarAnjos(Request $request){
$usuariosAnjos = User::where('usuario_anjo', '1')->get();
return response()->json($usuariosAnjos.email);
}
and:
public function avisarAnjos(Request $request){
$usuariosAnjos = User::where('usuario_anjo', '1')->get();
return response()->json($usuariosAnjos->email);
}
and
public function avisarAnjos(Request $request){
$usuariosAnjos = User::where('usuario_anjo', '1')->get();
return response()->json($usuariosAnjos['email']);
}
the answer to helped solve your problem?
– novic