Edujugon / PushNotification

PHP and Laravel Package to send push notifications to Android and IOS devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel 5.4 publishing config file error

pouriabagheri opened this issue · comments

publishing the config file ends with error in laravel 5.4 as Illuminate\Foundation\Application::share() been deprecated.

vendor/edujugon/push-notification/src/Providers/PushNotificationServiceProvider.php on line 32

 [Symfony\Component\Debug\Exception\FatalErrorException]              
  Call to undefined method Illuminate\Foundation\Application::share()

@pouriabagheri
Please run composer update in your terminal
let me know if that fixed the issue

@Edujugon yes and this is the result
[Symfony\Component\Debug\Exception\FatalErrorException] Call to undefined method Illuminate\Foundation\Application::share() Script php artisan optimize handling the post-update-cmd event returned with error code 255

@pouriabagheri,

Could you confirm that you have installed the 2.1.7 version ?
Also clear your project cache and try again. It was an issue with the previous version for apps with laravel ^5.3.

Now, with the v2.1.7 it works like a charm.

if that wouldn't work for you, please do the following:

composer remove edujugon/push-notification

then install it again:

composer require edujugon/push-notification

@Edujugon
I did remove and require again/ but the error persists. I didn't check the version but I assume it was v2.1.7 as i installed it with composer without specifying a version

@pouriabagheri,
I've just created a fresh laravel 5.4 app, pull in the package and run vendor:publish and it works fine for me. Even I sent a message and also worked. So I couldn't replicate your issue.

The package doesn't use that method and instead uses singleton. Please refer to the following link to see so:
https://github.com/Edujugon/PushNotification/blob/master/src/Providers/PushNotificationServiceProvider.php#L32

I'm pretty sure it's a cache issue.

@Edujugon Thanks It worked. I realised the difference and this time specified the version.

Glad to know you could solve it :)