ahmedsaoud31 / laravel-permission-to-vuejs

Laravel Permission Package To Use it in VueJs
89 stars 28 forks source link

Best practice to set window.Laravel from VueJS #11

Closed vanrijs closed 2 years ago

vanrijs commented 2 years ago

Hi!

I was wondering: what is the best wat to set this variable you use when I use Laravel only as backend (API)? window.Laravel

In your docs its coming from Laravel but I use Laravel only as backend. Ive added 'permissions' => $this->jsPermissions() to my User resource to I have this permissions available in my Vue frontend using {{ this.$auth.user }}

I think I have two options here:

Looking forward to your reply.

Regards,

Raymond

ahmedsaoud31 commented 2 years ago

Hi Raymond, See this: https://github.com/ahmedsaoud31/laravel-permission-to-vuejs/issues/4#issuecomment-860466190