Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class not found in ProviderRepository.php error with composer install

I'm currently in the process of trying to include this package in my Laravel app: https://github.com/tappleby/laravel-auth-token

I included "tappleby/laravel-auth-token": "0.3.*" in composer.json, like this:

"require": {
    "laravel/framework": "4.2.*",
    "intervention/image": "dev-master",
    "laracasts/flash": "~1.0",
    "laracasts/validation": "1.1.*",
    "tappleby/laravel-auth-token": "0.3.*"
}

And I added 'Tappleby\AuthToken\AuthTokenServiceProvider' and 'AuthToken'=>'Tappleby\Support\Facades\AuthToken','AuthTokenNotAuthorizedException' =>'Tappleby\AuthToken\Exceptions\NotAuthorizedException' to app/config/app.php.

Afterwards I ran composer install. This is the way I always added packages, but now I get an error every time: [RuntimeException]
Error Output: PHP Fatal error: Class 'Tappleby\AuthToken\AuthTokenServiceProvider' not found in /var/www/example.com/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157

like image 525
user4106707 Avatar asked Oct 05 '14 19:10

user4106707


4 Answers

Goto bootstrap/cache folder and delete config.php

Then run

composer dump-autoload
like image 100
Pasan Bhanu Guruge Avatar answered Oct 10 '22 04:10

Pasan Bhanu Guruge


As Marcin said you shouldn't use

composer install

but

composer update

Second thing remove all the lines added to app/config/app.php

First run composer update after that put those lines in app/config/app.php

Then run php artisan config:publish tappleby/laravel-auth-token in your command line

It should publish your configuration and now you should be able to use the relevant classes

like image 32
Muhammad Avatar answered Oct 10 '22 03:10

Muhammad


Order is mandatory, run composer update then add the service provider and aliases to app.php

like image 4
Razor Avatar answered Oct 10 '22 02:10

Razor


php artisan optimize:clear

composer install

If that don't work

  1. remove composer.lock
  2. remove vendor folder
  3. composer install
like image 4
geral Avatar answered Oct 10 '22 03:10

geral