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.

2.3.2(3w ago)024MITPHPPHP &gt;=8.2

Since Oct 23Pushed 3w 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 today

READMEChangelogDependencies (7)Versions (16)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

44

↑

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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 ~17 days

Recently: every ~56 days

Total

14

Last Release

26d 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M594](/packages/laravel-boost)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)

PHPackages © 2026

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