belbase / push-notification
This is the The Library of Push Notification for Firebase.
Requires
- php: >=5.4.0
- illuminate/support: ^5.2.0
Requires (Dev)
- phpunit/phpunit: ^4.0
This package is not auto-updated.
Last update: 2024-04-28 03:30:53 UTC
README
The Laravel 5 Package for Push Notification. Currently supported Services: Firebase Cloud Messaging
Installation
Step 1: Install package using composer
composer require belbase/push-notification
Step 2: Add the service provider to the config/app.php file in Laravel (Optional for Laravel 5.5)
Belbase\PushNotification\Providers\PushNotificationServiceProvider::class,
Step 3: Add an alias for the Facade to the config/app.php file in Laravel (Optional for Laravel 5.5)
'PushNotification' => Belbase\PushNotification\Facades\PushNotification::class,
Step 4: Publish the config by running in your terminal
php artisan vendor:publish
Usage
Edit the config/pushnotification.php. Set the appropriate Service and its parameters. Then in your code...
use PushNotification;
Initiate Request and Redirect using the default service:-
/* All Required Parameters by your Service */ $deviceAccessToken = 'DEVICE-ACCESS-TOKEN-HERE'; $metaData=[ // enter data to send along with notification ]; return PushNotification::to($deviceAccessToken)->setMessage('title','body',$metaData)->sendMessage();
Contributors
License
The PushNotification is open-sourced software licensed under the MIT license.