How to send data from laravel controller with a custom array to vuejs

  laravel, vue.js

Hi I send the axios with custom data like this one:'/api/hr_employee/days/'+ this.period_data.year +'/'+ this.period_data.month +'?page='+this.currentPage+'&api_token='+App.apiToken)
                .then(response => {

It displays this:

code: 200
data: "{"rut":["06152617-K"],"full_name":[""],"total_days":[30]}"
msg: ""

My controller code is this one:

BUT when I do this:


It says that it’s undefined but how you can see it is not undefined it should display 06152617-K so I wonder what I am doing wrong? if it comes with a value


Source: Laravel

Leave a Reply