0

I am planning to upgrade my own laravel from 5.1 to 6.0 however as what laravel suggest, it should be one step at a time. In one of the package, there is a oauth2 package called lucadegaspery and as what the author suggest as more than 5.2, this package is not compatible. Now, as i progressed the problem persist that this package needs to be considered when i want to do php artisan route:list for example. it will produce this error

C:\xampp\htdocs\paperinvoicer\core>php artisan route:list
PHP Fatal error:  Uncaught ReflectionException: Class LucaDegasperi\OAuth2Server\Authorizer does not exist in C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
Stack trace:
#0 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(809): ReflectionParameter->getClass()
#1 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(789): Illuminate\Container\Container->getDependencies(Array, Array)
#2 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(644): Illuminate\Container\Container->build('App\\Exceptions\\...', Array)
#3 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(709): Illuminate\Container\Container->make('App\\Exceptions\\...', Array)
#4 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(231): Illuminate\Foundation\Application->make('A in C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 809
PHP Fatal error:  Uncaught ReflectionException: Class LucaDegasperi\OAuth2Server\Authorizer does not exist in C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
Stack trace:
#0 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(809): ReflectionParameter->getClass()
#1 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(789): Illuminate\Container\Container->getDependencies(Array, Array)
#2 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(644): Illuminate\Container\Container->build('App\\Exceptions\\...', Array)
#3 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(709): Illuminate\Container\Container->make('App\\Exceptions\\...', Array)
#4 C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php(231): Illuminate\Foundation\Application->make('A in C:\xampp\htdocs\paperinvoicer\core\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 809

also, i have removed the package because again it doesn't support more than 5.2 version

I have done research, having 1+ day to resolve this issue but no luck including try to remove all Use (this package) no luck, earlier i have done removing the Use (this package) in each middleware also no luck

here is my composer.json now:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "barryvdh/laravel-ide-helper": "~2.0",
        "illuminate/html": "5.0.*@dev",
        "laracasts/flash": "~1.3",
        "intervention/image": "dev-master",
        "webpatser/laravel-uuid": "1.*",
        "dingo/api": "1.0.x@dev",
        "orangehill/iseed": "2.2",
        "guzzlehttp/guzzle": "6.2",
        "veritrans/veritrans-php": "dev-master",
        "doctrine/dbal": "2.5",
        "symfony/psr-http-message-bridge": "0.2",
        "rguedes/pdfmerger": "^1.0",
        "doctrine/inflector": "1.1.x",
        "simplesoftwareio/simple-qrcode": "1.5.1",
        "maatwebsite/excel": "~2.1.0",
        "league/flysystem-aws-s3-v3": "^1.0",
        "laravel/passport": "~1.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "symfony/dom-crawler": "3.1.*",
        "symfony/css-selector": "3.1.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database",
            "app/Http/Controllers/Api/V1"
        ],
        "psr-4": {
            "App\\": "app/",
            "Vendor\\" : "vendor"
        },
        "files":[
            "app/Http/helpers.php"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

It would be great if i can remove those class not found in the container so i can move on with the next version.

Yuko Pangestu
  • 193
  • 1
  • 2
  • 19
  • 1
    check your middleware kernel `app\Http\Kernel.php` maybe there's still leftover reference to the package. and remove all the associated middleware in `routes/*.php` files. – veelasky Sep 11 '19 at 19:23
  • Hi veelasky, fortunately yes this is the issue however, i got another error at hand. I will post the update as below – Yuko Pangestu Sep 12 '19 at 03:02

0 Answers0