PHPackages                             palpalani/bayrewards-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. palpalani/bayrewards-laravel

ActiveLibrary[API Development](/categories/api)

palpalani/bayrewards-laravel
============================

BayRewards PHP SDK for Laravel Framework - A comprehensive rewards platform integration for e-commerce stores.

v0.4.0(6mo ago)38.2k↓50%MITPHPPHP ^8.3CI passing

Since Jul 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/palpalani/bayrewards-laravel)[ Packagist](https://packagist.org/packages/palpalani/bayrewards-laravel)[ Docs](https://github.com/palpalani/bayrewards-laravel)[ GitHub Sponsors](https://github.com/palpalani)[ RSS](/packages/palpalani-bayrewards-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (18)Used By (0)

BayRewards Laravel
==================

[](#bayrewards-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/547f85c21c0daac4c2d417732dcb4d125f28eee35b6622f12c5cbdae63102b76/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70616c70616c616e692f626179726577617264732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palpalani/bayrewards-laravel)[![Total Downloads](https://camo.githubusercontent.com/7a637d9d8805892fcdd42c2d7e045db2589508aa91881bc88a2fd195066b5d16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70616c70616c616e692f626179726577617264732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palpalani/bayrewards-laravel)[![PHP Version](https://camo.githubusercontent.com/9f9b82c7799c42fb98a9632a1679a7290b2c72440631802c9fd99f4ed06af468/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f70616c70616c616e692f626179726577617264732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palpalani/bayrewards-laravel)[![Laravel Version](https://camo.githubusercontent.com/c5636cbc00edeb2fc30bc0a089aca31231cc9b87845c6d56b74fb9e2fc931b02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com)[![GitHub Tests Action Status](https://camo.githubusercontent.com/762fd9c4cb414a597799d7d0fea66aae67cd85d1efb84ee940d5b9e8ce2adffe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616c70616c616e692f626179726577617264732d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/palpalani/bayrewards-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0b2a8ee1af996e9fdc3cb428e3c97434c771f8a26b3c9dd75cd066fb2395e016/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616c70616c616e692f626179726577617264732d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/palpalani/bayrewards-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![License](https://camo.githubusercontent.com/e4c121dc9a20e1ea0e8e1f4c0305fb965191ce62a1b6d4e4157395091bdaeff4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70616c70616c616e692f626179726577617264732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palpalani/bayrewards-laravel)

> BayRewards PHP SDK for Laravel Framework.

[BayRewards](https://bayrewards.io) revolutionizes e-commerce engagement with a comprehensive rewards platform. Seamlessly integrated with online stores, [BayRewards](https://bayrewards.io) offers point programs, referral incentives, and VIP perks to drive customer loyalty and sales. Elevate your e-commerce experience by incentivizing purchases, encouraging referrals, and rewarding VIP customers with exclusive benefits. With [BayRewards](https://bayrewards.io), businesses can effortlessly cultivate customer relationships and foster brand advocacy, leading to increased retention and revenue.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Using the Facade](#using-the-facade)
    - [Using Dependency Injection](#using-dependency-injection)
    - [Get Store Details](#get-store-details)
    - [Get Store Features](#get-store-features)
    - [Create Activity](#create-activity)
    - [Get Activity](#get-activity)
    - [Update Activity](#update-activity)
    - [Update Loyalty Points](#update-loyalty-points)
    - [Get Store Customers](#get-store-customers)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Credits](#credits)
- [License](#license)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 10.0 | &gt;= 11.0 | &gt;= 12.0

Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org):

```
composer require palpalani/bayrewards-laravel
```

The package will automatically register its service provider and facade.

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag="bayrewards-laravel-config"
```

This will create a `config/bayrewards-laravel.php` file in your config directory.

### Environment Variables

[](#environment-variables)

Add the following to your `.env` file:

```
BAYREWARDS_BASE_URL=https://api.bayrewards.io
```

Replace the URL with your actual BayRewards API base URL.

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

The package provides a `BayRewards` facade for easy access:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
```

### Using Dependency Injection

[](#using-dependency-injection)

You can also use dependency injection:

```
use Palpalani\BayRewards\BayRewards;

class YourController
{
    public function index()
    {
        $bayRewards = BayRewards::client();
        // Use $bayRewards...
    }
}
```

### Get Store Details

[](#get-store-details)

Retrieve store details after integrating with BayRewards.io:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
$store = $bayRewards->storeDetails()->get('');
```

### Get Store Features

[](#get-store-features)

Get available features for a store:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
$features = $bayRewards->getStoreFeatures()->get('');
```

### Create Activity

[](#create-activity)

Create a new BayRewards activity:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->createActivity()->post('', [
    'title' => 'Purchase Reward', // Required
    'icon' => 'https://example.com/icon.png', // Required
]);
```

### Get Activity

[](#get-activity)

Retrieve activity details:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->getActivity()->get('', '');
```

### Update Activity

[](#update-activity)

Update an existing activity:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
$activity = $bayRewards->updateActivity()->post('', [
    'title' => 'Updated Purchase Reward', // Required
    'icon' => 'https://example.com/updated-icon.png', // Required
    'activity_id' => 12345, // Required
]);
```

### Update Loyalty Points

[](#update-loyalty-points)

Update loyalty points for a customer:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();
$updatePoints = $bayRewards->updatePoints()->post('', [
    'activity_id' => 12345, // Required - from activity payload
    'customer_email' => 'customer@example.com', // Required
]);
```

### Get Store Customers

[](#get-store-customers)

Retrieve all customers for a store with optional pagination and filtering:

```
use Palpalani\BayRewards\Facades\BayRewards;

$bayRewards = BayRewards::client();

// Get all customers with default pagination
$customers = $bayRewards->allCustomers()->get('');

// Get customers with custom pagination and filters
$customers = $bayRewards->allCustomers()->get(
    '', // Required
    1,                      // Optional - page number (default: 1)
    25,                     // Optional - limit per page (default: 25)
    'vip',                  // Optional - customer type filter (default: null)
    'john'                  // Optional - search query (default: '')
);
```

Testing
-------

[](#testing)

Run the tests with:

```
composer test
```

For test coverage:

```
composer test-coverage
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [palPalani](https://github.com/palpalani)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance78

Regular maintenance activity

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Recently: every ~136 days

Total

14

Last Release

183d ago

PHP version history (3 changes)0.1.0PHP ^8.1

0.2.0PHP ^8.2

v0.4.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/716695?v=4)[Palaniappan P](/maintainers/palpalani)[@palpalani](https://github.com/palpalani)

---

Top Contributors

[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (143 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (40 commits)")[![prasantargetbay](https://avatars.githubusercontent.com/u/121081197?v=4)](https://github.com/prasantargetbay "prasantargetbay (20 commits)")[![cvinoth-kumar](https://avatars.githubusercontent.com/u/143263380?v=4)](https://github.com/cvinoth-kumar "cvinoth-kumar (4 commits)")[![vinothkumar95](https://avatars.githubusercontent.com/u/120662401?v=4)](https://github.com/vinothkumar95 "vinothkumar95 (3 commits)")

---

Tags

apilaravelsdklaravel-packagee-commercerewardspointspalpalanireferralloyaltybayrewards

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/palpalani-bayrewards-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/palpalani-bayrewards-laravel/health.svg)](https://phpackages.com/packages/palpalani-bayrewards-laravel)
```

###  Alternatives

[kyon147/laravel-shopify

Shopify package for Laravel to aide in app development

473252.9k](/packages/kyon147-laravel-shopify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
