PHP code example of superbalist / laravel-localytics-push

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

    

superbalist / laravel-localytics-push example snippets


'providers' => [
    // ...
    Superbalist\LaravelLocalyticsPush\LocalyticsServiceProvider::class,
]

'aliases' => [
    // ...
    'Localytics' => Superbalist\LaravelLocalyticsPush\LocalyticsFacade::class,
]

$message = [
    'target' => [
        'profile' => [
            'criteria' => [
                [
                    'key' => '$email',
                    'scope' => 'Organization',
                    'type' => 'string',
                    'op' => 'in',
                    'values' => [
                        '[email protected]',
                    ]
                ]
            ],
            'op' => 'and',
        ],
    ],
    'alert' => [
        'title' => 'Message Title',
        'body' => 'This is my message content!',
    ]
];
Localytics::pushMessage('profile', $message);
bash
php artisan vendor:publish --provider="Superbalist\LaravelLocalyticsPush\LocalyticsServiceProvider"