PHPackages                             redeemly-likecard/luckycode-package - 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. redeemly-likecard/luckycode-package

ActiveLibrary[API Development](/categories/api)

redeemly-likecard/luckycode-package
===================================

Seamlessly integrate Redeemly LuckyCode rewards into any PHP application. This framework-agnostic PHP client provides full API coverage (pull, reveal, redeem, customer logs) with dedicated service providers and facades for Laravel, and straightforward integration for CodeIgniter and other PHP frameworks.

v2.1.0(6mo ago)016MITPHPPHP &gt;=8.2

Since Oct 23Pushed 6mo agoCompare

[ Source](https://github.com/Redeemly-LikeCard/Backend-PHP)[ Packagist](https://packagist.org/packages/redeemly-likecard/luckycode-package)[ RSS](/packages/redeemly-likecard-luckycode-package/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (11)Used By (0)

🚀 LuckyCode Integration Helper
==============================

[](#-luckycode-integration-helper)

*LuckyCode Integration Helper* is a PHP library for integrating with the *LuckyCode API*. It provides a clean abstraction layer with typed request/response DTOs, automatic token management, and optional Laravel support for quick and seamless integration.

---

🧩 Features
----------

[](#-features)

✅ Framework-agnostic core (works with Laravel, Symfony, CodeIgniter, etc.) ✅ Optional Laravel bridge (Service Provider, Config, Routes) ✅ Guzzle-based HTTP client ✅ In-memory token caching and auto-refresh ✅ Strongly typed DTOs and consistent ApiResponse model ✅ Optional PSR-3 compatible logging

---

⚙ Requirements
--------------

[](#-requirements)

- PHP *8.2+*
- Composer
- Optional: Laravel *11* or *12*

---

📦 Installation
--------------

[](#-installation)

### 🧱 Option 1 — Local Path Repository

[](#-option-1--local-path-repository)

In your main project’s composer.json, add the local path repository:

json { "repositories": \[ { "type": "path", "url": "./laravel" } \] }

Then require the package:

bash composer require luckycode/integration-helper:dev-main

---

⚙ Configuration
---------------

[](#-configuration)

Add the following environment variables (or your framework’s equivalent):

bash LUCKYCODE\_BASE\_URL=LUCKYCODE\_API\_KEY=your\_api\_key\_here LUCKYCODE\_CLIENT\_ID=your\_client\_id\_here LUCKYCODE\_SSL\_VERIFY=true

---

💡 Usage (Framework-Agnostic)
----------------------------

[](#-usage-framework-agnostic)

php use LuckyCode\\IntegrationHelper\\Services\\LuckyCodeService; use LuckyCode\\IntegrationHelper\\Models\\PullCodeRequest;

$service = new LuckyCodeService( baseUrl: getenv('LUCKYCODE\_BASE\_URL') ?: '', apiKey: getenv('LUCKYCODE\_API\_KEY') ?: '', clientId: getenv('LUCKYCODE\_CLIENT\_ID') ?: '', sslVerify: true );

$request = new PullCodeRequest(\[ 'orderRef' =&gt; 'ORDER-001', 'customerRef' =&gt; 'CUST-001' \]);

$response = $service-&gt;pullCode($request);

if ($response-&gt;success) { print\_r($response-&gt;data); } else { echo "Error: " . $response-&gt;error-&gt;message; }

---

🧩 Laravel Integration (Optional)
--------------------------------

[](#-laravel-integration-optional)

### 1️⃣ Publish Configuration (optional)

[](#1️⃣-publish-configuration-optional)

bash php artisan vendor:publish --tag=config --provider="LuckyCode\\IntegrationHelper\\IntegrationHelperServiceProvider"

This will create the config file:

config/luckycode.php

---

### 2️⃣ Add environment variables in .env

[](#2️⃣-add-environment-variables-in-env)

bash LUCKYCODE\_BASE\_URL=LUCKYCODE\_API\_KEY=your\_api\_key\_here LUCKYCODE\_CLIENT\_ID=your\_client\_id\_here LUCKYCODE\_SSL\_VERIFY=true

---

### 3️⃣ Use it in your Laravel code

[](#3️⃣-use-it-in-your-laravel-code)

php use LuckyCode\\IntegrationHelper\\Services\\Contracts\\LuckyCodeServiceContract; use LuckyCode\\IntegrationHelper\\Models\\PullCodeRequest;

$service = app(LuckyCodeServiceContract::class);

$response = $service-&gt;pullCode(new PullCodeRequest(\[ 'orderRef' =&gt; 'ORD-123', 'customerRef' =&gt; 'CUST-456', \]));

if ($response-&gt;success) { dd($response-&gt;data); } else { dd($response-&gt;error); }

---

🌐 Available Laravel Routes
--------------------------

[](#-available-laravel-routes)

If routes are enabled in your project, the following endpoints will be available:

HTTPEndpointDescription*POST*/api/lucky-code/pullPull a single code*POST*/api/lucky-code/revealReveal a code*POST*/api/lucky-code/redeemRedeem a code*POST*/api/lucky-code/multi-pullPull multiple codes at once*GET*/api/lucky-code/check-serialcode?serialCode=CODE123Validate a serial code*GET*/api/lucky-code/customer-log?page=1&amp;pageSize=30&amp;customerRef=CUST001Retrieve customer code log---

🪵 Logging (Optional)
--------------------

[](#-logging-optional)

You can pass any *PSR-3 compatible logger*, or leave it null to disable logging.

php use Monolog\\Logger; use Monolog\\Handler\\StreamHandler; use LuckyCode\\IntegrationHelper\\Services\\LuckyCodeService;

$logger = new Logger('luckycode'); $logger-&gt;pushHandler(new StreamHandler(**DIR**.'/luckycode.log', Logger::INFO));

$service = new LuckyCodeService( baseUrl: '', apiKey: 'your\_api\_key', clientId: 'your\_client\_id', sslVerify: true, logger: $logger );

---

🔐 Security Notes
----------------

[](#-security-notes)

⚠ Never commit your API keys or client IDs to source control. Always use environment variables or a secure secret store.

---

🧾 Directory Structure
---------------------

[](#-directory-structure)

src/ ├── Models/ # DTO classes (PullCodeRequest, RevealCodeRequest, etc.) ├── Services/ # Service logic for LuckyCode API ├── Support/ # ApiResponse, ErrorDto, Helpers ├── Http/Controllers/ # Laravel bridge (optional) ├── IntegrationHelperServiceProvider.php # Laravel service provider config/ └── luckycode.php

---

🧠 Tips
------

[](#-tips)

- Use *multi-pull* when you need to pull several codes in one request.
- Use *getCustomersLog* to retrieve the customer’s prize or code history.
- Every API call returns an ApiResponse object:

    php $response-&gt;success; // bool $response-&gt;data; // mixed $response-&gt;error; // ErrorDto|null

---

🧰 Troubleshooting
-----------------

[](#-troubleshooting)

ProblemPossible CauseSolutionSSL errorSelf-signed certificateSet LUCKYCODE\_SSL\_VERIFY=false (only in development)“401 Unauthorized”Invalid API key or client IDCheck .env valuesEmpty responseWrong base URLMake sure LUCKYCODE\_BASE\_URL points to the correct APITimeoutAPI not reachableVerify the endpoint or network connectivity---

🧩 License
---------

[](#-license)

MIT License © Redeemly LuckyCode Integration Helper

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance71

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

10

Last Release

193d ago

Major Versions

v1.4.0 → v2.0.02025-10-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/0216c07a65da9ecdd4f0b341afd69d511e9d813bc1325397d01cb70316d873f2?d=identicon)[redeemly-likecard](/maintainers/redeemly-likecard)

---

Top Contributors

[![Redeemly-LikeCard](https://avatars.githubusercontent.com/u/239739905?v=4)](https://github.com/Redeemly-LikeCard "Redeemly-LikeCard (13 commits)")

### Embed Badge

![Health badge](/badges/redeemly-likecard-luckycode-package/health.svg)

```
[![Health](https://phpackages.com/badges/redeemly-likecard-luckycode-package/health.svg)](https://phpackages.com/packages/redeemly-likecard-luckycode-package)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M368](/packages/laravel-zero-framework)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)

PHPackages © 2026

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