I am developing with Laravel 5.3 . I am using fractal as well. I also axios as Http Client to perform Ajax Requests.
If i send a get request to display all chairs api. I am returned with the display below:

I am using VueJS 2 to parse the values to the html view.
ChairsController.php
public function index()
{
$chairs = Chair::paginate(25);
// Return a collection of $chair with pagination
return $this->response->withPaginator($chairs, new ChairTransformer());
}
app-vue.js
new Vue({
el: '#app',
data: {
chairs: []
},
mounted() {
axios.get('http://l5.app:8000/api/v1/chairs').then(response => this.chairs = response.data);
}
});
getchairs.blade.php
<div id="app">
<ul>
<li v-for="chair in chairs">{{ color }}</li>
</ul>
</div>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<script src="js/app-vue.js"></script>
When i access getchairs.blade.php in the browser, there is error:
2/2
ErrorException in c5c35433.php line 72:
Use of undefined constant color - assumed 'color' (View: /home/vagrant/sites/l5/resources/views/dev/getchairs.blade.php)
How to access the color value and iterate through according to the total number of records? Any help is appreciated.