please could you guide me how to show the roles of the users. I have in the controller
public function index()
{
$usuarios = User::all();
$listaroles = User::with('roles')->get();
return response()->json(['datausers' => $usuarios,'listaroles' => $listaroles,], 200);
}
and in the methods I have:
leerUsuario() {
axios.get('/usuarios') .then(response => {
this.items = response.data.datausers;
this.roles = response.data.listaroles;
});
}
but I do not know how to list them in vue according to each user.