ahmedsaoud31 / laravel-permission-to-vuejs

Laravel Permission Package To Use it in VueJs
96 stars 30 forks source link

Laravel permission to Vuejs

Update: now support Vue 3

npm package

Total Downloads Version License

Composer package

Total Downloads License

After installed you can do like this in Vuejs:

<div v-if="can('edit post')">
  <!-- Edit post form -->
</div>

<div v-if="is('super-admin')">
  <!-- Show admin tools -->
</div>

<!-- you can use OR operator -->
<div v-if="can('edit post | delete post | publish post')">
  <!-- Do something -->
</div>

<div v-if="is('editor | tester | user')">
  <!-- Do something -->
</div>

<!-- you can use AND operator -->
<div v-if="can('edit post & delete post & publish post')">
  <!-- Do something -->
</div>

<div v-if="is('editor & tester & user')">
  <!-- Do something -->
</div>

If you need to use it in Githubissues.

  • Githubissues is a development platform for aggregating issues.