0.1.0 • Published 6 years ago

vue-laracan v0.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

VueLaracan

Access Laravel's Policies using laracan in Vue components.

Getting Started

You can access method 'can' in any Vue component, but make sure that Authorization token is sent so user is signed in.

Vue Component Example:

async mounted() {
    this.can_edit_article = await this.can('Article', 'edit', this.article_id)
}

Installing

Note: Before you use this plugin in Vue project, make sure that you have installed this package in your Laravel project.

npm i vue-laracan
Vue.use(Laracan, {
    laravelBaseURL: "http://laravel-app.com" // url to your laravel app 
})