PHP code example of palpalani / bayrewards-laravel

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

    

palpalani / bayrewards-laravel example snippets


return [
    'bayrewards_base_url' => env('BAYREWARDS_BASE_URL')
];

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$store = $client->storeDetails()->get('<Store-Access-Token>');

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->createActivity()->post('<Store-Access-Token>', [
        "title" => "Title of the Activity name", //

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->updateActivity()->post('<Store-Access-Token>', [
        "title" => "Title of the Activity name", //

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$updatePoints = $bayRewards->updatePoints()->post('<Store-Access-Token>', [
    "activity_id" => '<From activity payload>', //

use Palpalani\BayRewards\BayRewards;

$bayRewards = BayRewards::client();
$store = $bayRewards->allCustomers()->get(
'<Store-Access-Token>, //h'
);
bash
php artisan vendor:publish --tag="bayrewards-laravel-config"