[Vuejs]-Best place for function which checks permissions in vue.js

0👍

You should not use window globals to pass around your configuration. You should set up a route in Laravel and make an ajax call with your Vue.js application to get your configuration for the specific user.

Something like Axios can help with your ajax calls:

https://github.com/mzabriskie/axios

Laracasts has plenty of Vue.js material including how to work this into Vue.js.

To generate a json response you can use:

https://laravel.com/docs/5.4/responses#json-responses

Leave a comment