PHP code example of witty / laravel-push-notification

1. Go to this page and download the library: Download witty/laravel-push-notification library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

witty / laravel-push-notification example snippets


'providers' => array(
    'Witty\LaravelPushNotification\PushNotificationServiceProvider'
)

'aliases' => array(
	'PushNotification'      => 'Witty\LaravelPushNotification\PushNotification',
)

array(
    'iOS'     => [
        'environment' => env('IOS_PUSH_ENV', 'development'),
        'certificate' => env('IOS_PUSH_CERT', __DIR__ . '/ios-push-notification-certificates/development/certificate.pem'),  
        'passPhrase'  => env('IOS_PUSH_PASSWORD', '291923Job'),
        'service'     => 'apns'
    ],

    'android' => [
        'environment' => env('ANDROID_PUSH_ENV', 'development'),
        'apiKey'      => env('ANDROID_PUSH_API_KEY', 'yourAPIKey'),
        'service'     => 'gcm'
    ]
);


PushNotification::app('iOS')
                ->to($deviceToken)
                ->send('Hello World, i`m a push message');


php artisan vendor:publish