When I am using latest Laravel 5.2.2 and Entrust ("zizaco/entrust": "5.2.x-dev") I face this error and not sure how to solve this:
Call to undefined method Zizaco\Entrust\EntrustServiceProvider::hasRole()
I tested this code on HomeController.php
use Entrust;
class HomeController extends Controller
{
public function index()
{
if (Entrust::hasRole('admin')) {
echo "string";
}
return view('home');
}
}
This is my config/app.php service provider
Zizaco\Entrust\EntrustServiceProvider::class
config/app.php facade alias
'Entrust' => Zizaco\Entrust\EntrustFacade::class
I also already generate the model needed
Did I miss something here?
I have same issue, here are the steps I have taken to solve the issue
In your .env file change to cache array
CACHE_DRIVER=array
and dont forget to run
php artisan config:cache
It seems all the steps is correct, and I just need to clear the cache with php artisan config:cache
And if you face an error like below
BadMethodCallException in vendor\laravel\framework\src\Illuminate\Cache\Repository.php line 380:
This cache store does not support tagging.
You need to change in .env this line to array
CACHE_DRIVER=array
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With