ahmedsaoud31 / laravel-permission-to-vuejs

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

i get Uncaught SyntaxError: Unexpected token '}' error #7

Closed ninja71-mn closed 2 years ago

ninja71-mn commented 2 years ago

Hi i use this package in spa app, vue 3 and laravel 8 and sanctum but i get this error

Uncaught SyntaxError: Unexpected token '}'

image

ahmedsaoud31 commented 2 years ago

Check that you add

use LaravelAndVueJS\Traits\LaravelPermissionToVueJS;

// Spatie package
use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable
{
    use LaravelPermissionToVueJS;

    // Spatie package
    use HasRoles;

    // ...
}

In your User Model