Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined method Illuminate\Database\Query\Builder::cachedPermissions() #566

Closed
shanka12 opened this issue Apr 12, 2016 · 16 comments

Comments

@shanka12
Copy link

When I use ability method, i'm getting following error (laravel 5.2)

ErrorException in Builder.php line 2161:
Call to undefined method Illuminate\Database\Query\Builder::cachedPermissions()

@rameshpaudel
Copy link

I am getting the same error

BadMethodCallException in Builder.php line 2251:
Call to undefined method Illuminate\Database\Query\Builder::attachRolesToUser()

@shanka12
Copy link
Author

shanka12 commented May 2, 2016

@rameshpaudel Did you find the solution?

@rameshpaudel
Copy link

rameshpaudel commented May 3, 2016

@shanka12 Changing the .env CACHE_DRIVER=array solved my problem however, I think its not a permanent solution. But be aware the throttle doesn't seem to work after updating the CACHE_DRIVER. Took most of my time debugging throttle when the error was on the .env file.

@praveensns
Copy link

praveensns commented May 5, 2016

add this line in composer.json
"zizaco/entrust": "5.2.x-dev"
then do composer update

@shanka12
Copy link
Author

shanka12 commented May 7, 2016

@rameshpaudel I am already using array. still not work ability method.
@praveensns I am using same version

@shanka12 shanka12 closed this as completed May 7, 2016
@mupmzfqot
Copy link

Any solution ?
I am already using CACHE_DRIVER=array and "zizaco/entrust": "5.2.x-dev". But same.

@vrkansagara
Copy link

the same problem with my code also.

@vrkansagara
Copy link

vrkansagara commented Jul 20, 2016

Hello Guys I found the quick solution for this issue is do as bellow.

find the Role.php file and updated as bellow
use Zizaco\Entrust\EntrustRole;

and extend with EntrustRole
Hope it work for you also. 👍

@wugang8068
Copy link

vrkansagara's answer worked for me!

@vrkansagara
Copy link

@wugang8068 👍

@LivingStonZhang
Copy link

use Zizaco\Entrust\EntrustRole;

and extend with EntrustRole
This solution is useful for my productI hope you guys can try @vrkansagara Thank you

@epalen
Copy link

epalen commented Dec 17, 2016

I have this same error in the version of Laravel 5.3 and I have tried the above indications and the error persists.

Does anyone have a solution in this case?

@THEMBOCHARLES
Copy link

After changing CACHE_DRIVER=file to CACHE_DRIVER=array. Stop the artisan server and then restart it.

@THEMBOCHARLES
Copy link

THEMBOCHARLES commented Feb 1, 2017

But the best solution for me was.

  1. set app/cache to 'default' => env('CACHE_DRIVER', 'redis'),
    2.CACHE_DRIVER=redis
    SESSION_DRIVER=redis in .env
  2. In your composer.json add "predis/predis": "^1.1"
  3. run composer update
    5.restart your artisan server.
  4. It works

@afrasiyabhaider
Copy link

Same error

@vrkansagara
Copy link

@afrasiyabhaider I moved to another package so cant able to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants