berkayk / laravel-onesignal

OneSignal Push Notifications for Laravel
506 stars 176 forks source link

Integration With Lumen #101

Open appsdev85 opened 5 years ago

appsdev85 commented 5 years ago

Hi,

I tried to add your library to my lumen project, so i registered the provider and alias in the bootstrap/app.php

$app->register(Berkayk\OneSignal\OneSignalServiceProvider::class);

class_alias(Berkayk\OneSignal\OneSignalFacade::class,'OneSignal');

but i'm getting the following error,

Call to undefined function Berkayk\OneSignal\config_path() in OneSignalServiceProvider.php line 18

of curse cause lumen don't have this function, although you add this code for lumen i think in the OneSignalServiceProvider.php

if ( class_exists('Laravel\Lumen\Application') ) {
            $this->app->configure('onesignal');
        } 

Any help will be much appreciated.

berkayk commented 5 years ago

This must be fixed with the latest release.

ThaDaVos commented 5 years ago

Why is it still in the source? Or are you talking about Lumen 6.*?

canerd7u commented 4 years ago

@HWSTS https://gist.github.com/mabasic/21d13eab12462e596120 add helper class in config_path function.

rvkvino commented 4 years ago

Hello I used OneSignal::sendNotificationToAll() but it showing Class 'OneSignal' not found error showing.

suijt commented 1 year ago

@HWSTS https://gist.github.com/mabasic/21d13eab12462e596120 add helper class in config_path function.

this solved the issue