1

I am tried to upgrading from Laravel 5.3 to Laravel 5.4 , but when run composer update in php artisan optimize, i get an error in SentryServiceProvider. this is error message :

In SentryServiceProvider.php line 77: Call to undefined method Illuminate\Foundation\Application::share()

this is my composer.json

    {
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.4.36",
        "doctrine/dbal": "2.5",
        "cartalyst/sentry": "dev-feature/laravel-5",
        "tymon/jwt-auth": "0.5.*",
        "guzzlehttp/guzzle": "^6.2",
        "barryvdh/laravel-cors": "0.9.x",
        "guzzlehttp/oauth-subscriber": "0.3.*",
        "intervention/image": "2.3",
        "yajra/laravel-datatables-oracle": "6.3",
        "yaro/log-envelope": "1.*",
        "mcamara/laravel-localization": "1.0.*",
        "schuppo/password-strength": "~1.5",
        "maatwebsite/excel": "2.1.29",
        "tecnick.com/tcpdf": "~6.0.0",
        "cviebrock/eloquent-sluggable": "^3.1",
        "predis/predis": "^1.0",
        "nicolaslopezj/searchable": "1.*",
        "zizaco/entrust": "5.2.x-dev",
        "facebook/php-sdk-v4": "~5.0",
        "facebook/graph-sdk": "^5.3",
        "torann/currency": "^0.3.1",
        "league/flysystem-aws-s3-v3": "^1.0",
        "s-ichikawa/laravel-sendgrid-driver": "~1.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.7",
        "phpspec/phpspec": "~2.1",
        "symfony/dom-crawler": "~3.1",
        "symfony/css-selector": "~3.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

I have tried change something code share() in the SentryServiceProvider.php to singleton() but its not worked. And I tried to research for updating the cartalyst/sentry in packagist, but, the version not updated and Deprecated.

Dhiemas Ganisha
  • 223
  • 2
  • 15
  • https://stackoverflow.com/questions/45979096/laravel-call-to-undefined-method-illuminate-foundation-applicationshare – Cornel Verster May 28 '20 at 22:10
  • how about the sentry? @CornelVerster – Dhiemas Ganisha May 28 '20 at 22:17
  • @CornelVerster I have tried to follow the instructions, but when i run php artisan optimize, error `In Container.php line 1090: Illegal offset type in unset` – Dhiemas Ganisha May 28 '20 at 22:21
  • are you making an incorrect call to a singleton somwhere? It's hard to say, because we can't see your code. – Cornel Verster May 28 '20 at 22:26
  • in my Container.php , already available function singleton. then in `SentryServiceProvider` i tried any `show` to `singleton` – Dhiemas Ganisha May 28 '20 at 22:29
  • please post the code – Cornel Verster May 28 '20 at 22:29
  • According to the [5.3 to 5.4 upgrade guide](https://laravel.com/docs/5.4/upgrade) `share` had been removed in favour of `singleton`. The sentry package you seem keen on using looks abandoned. I suggest you find an alternative that works with versions of laravel and PHP that are still receiving security updates. The people who made it suggest switching to [sentinel](https://github.com/cartalyst/sentinel) – apokryfos May 28 '20 at 22:36

1 Answers1

0

try to run composer update --ignore-platform-reqs

MostafaHashem
  • 127
  • 2
  • 3