vue-laracan
v0.1.0
Published
Access laracan in Vue components
Downloads
1
Readme
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
})