0

I am working on Laravel project that is using the following libraries:

  • Spatie/Laravel-Permissions
  • Laravel-Backpack Base, Crud
  • Laravel-Backpack/PermissionManager

Every time, I try to create new role or permission from the admin interface, I get the this error:

Call to undefined method Spatie\Permission\Models\Role::translationEnabled()

I have already done the necessary setup, but cant seem make this work.

Thanks in advance!

Edit:

The error is triggered by a call on line 1 of this view:

https://github.com/Laravel-Backpack/CRUD/blob/master/src/resources/views/form_content.blade.php

apokryfos
  • 38,771
  • 9
  • 70
  • 114
tank
  • 319
  • 6
  • 15

2 Answers2

1

Try to replace default Roles and Permission models on backup's

in the file config/permission.php replace:

'permission' => Spatie\Permission\Models\Permission::class,    
to
'permission' => \Backpack\PermissionManager\app\Models\Permission::class,
    

And

'role' => Spatie\Permission\Models\Role::class,
to
'role' => \Backpack\PermissionManager\app\Models\Role::class,
York
  • 31
  • 3
0

I was able to solve the issue. I had already installed Spatie/Laravel-Permissions before installing Laravel-Backpack/PermissionManager which require the same library. However, I had made some changes to the config that had overwritten the configuration for PermissionManager which caused the error. Removing those configurations solved the issue.

tank
  • 319
  • 6
  • 15