List Roles in Vue with laravel 5.6

0

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.

    
asked by Néstor Miguel Ávila Olivar 26.10.2018 в 04:52
source

0 answers