PHP code example of marcelopetrucio / onesignal-laravel

1. Go to this page and download the library: Download marcelopetrucio/onesignal-laravel 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/ */

    

marcelopetrucio / onesignal-laravel example snippets


'providers' => [
	// ...
	Berkayk\OneSignal\OneSignalServiceProvider::class
];

'aliases' => [
	// ...
	'OneSignal' => Berkayk\OneSignal\OneSignalFacade::class
];

    OneSignal::app("appNumberOne")
        ->message("Some Message")                    
        ->send();

    OneSignal::app("appNumberOne")
        ->message("Some Message") 
        ->filters(
	    array(
	        ["field" => "email", "relation" => "=", "value" => "[email protected]"],
	        ["field" => "email", "relation" => "=", "value" => "[email protected]"],
	    )
        )->send();

    OneSignal::app("appNumberOne")
        ->message("Some Message") 
        ->filters(
	    array(
	        ["field" => "session_count", "relation" => ">", "value" => '2'],
	        ["field" => "first_session", "relation" => ">", "value" => '2000'],
	    )
        )->send();

    OneSignal::app("app_teste")
        ->message("Some Message") 
        ->

    OneSignal::app("app_teste")
    	->message("Some Message") 
    	->

    OneSignal::sendNotificationCustom($parameters);

    OneSignal::async()->sendNotificationCustom($parameters);

php artisan vendor:publish --tag=config