Zizaco / entrust

Role-based Permissions for Laravel 5
MIT License
6.05k stars 1.29k forks source link

cannot use php artisan after installation 'ReflectionException' with message 'Class config does not exist' #515

Open michaeltansy opened 8 years ago

michaeltansy commented 8 years ago

Hi i got this issue after the installation. I already add ServiceProvider and the facade to config/auth and add 3 middleware to Kernel. After adding them, I tried to publish the vendor but the result is

Fatal error: Uncaught exception 'ReflectionException' with message 'Class config does not exist' in \vendor\laravel\framework\src\Illuminate\Container\Container.php:738

Stack trace:

0 C:\xampp\htdocs\library-api\vendor\laravel\framework\src\Illuminate\Container\Container.php(738): ReflectionClass->__construct('config')

1 C:\xampp\htdocs\library-api\vendor\laravel\framework\src\Illuminate\Container\Container.php(633): Illuminate\Container\Container->build('config', Array)

2 C:\xampp\htdocs\library-api\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('config', Array)

3 C:\xampp\htdocs\library-api\vendor\laravel\framework\src\Illuminate\Container\Container.php(1178): Illuminate\Foundation\Application->make('config')

4 C:\xampp\htdocs\library-api\vendor\laravel\framework\src\Illuminate\Support\ServiceProvider.php(65): Illuminate\Container\Container->offsetGet('config')

5 C:\xampp\htdocs\library-api\vendor\dingo\api\src\Provider\ApiSe in C:\xampp\htdocs\library-api\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 738

Could you please help me to solve this? @andrewelkins

ghost commented 8 years ago

You added the ServiceProvider to config/auth? It needs to go in config/app.

Anywho, I believe I saw an error about this,

Go to

vendor > zizaco > entrust > src > Entrust > EntrustServiceProvider and find the method, bindShared() and change to singleton()

Issue: https://github.com/Zizaco/entrust/issues/496