PHPackages                             codebuglab/laravel-like4card - 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. codebuglab/laravel-like4card

ActiveLibrary[API Development](/categories/api)

codebuglab/laravel-like4card
============================

Integrate Like4Card API with Laravel

v0.0.3(4y ago)1983[2 issues](https://github.com/codebuglab/laravel-like4card/issues)[1 PRs](https://github.com/codebuglab/laravel-like4card/pulls)MITPHPPHP &gt;=7.0

Since May 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/codebuglab/laravel-like4card)[ Packagist](https://packagist.org/packages/codebuglab/laravel-like4card)[ Docs](https://github.com/akhled/laravel-like4card)[ RSS](/packages/codebuglab-laravel-like4card/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

Laravel Like4Card
==================

[](#laravel-like4card-)

Integrate [Like4Card](http://like4card.com/) api with Laravel.

[![Laravel Like4Card](banner.png)](banner.png)

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

[](#table-of-contents-)

- [Installation](#installation)
- [Config](#config)
- [Available api methods](#available-api-methods)
    - [Get merchant balance](#get-merchant-balance)
    - [Categories](#categories)
    - [Products by products ids](#products-by-products-ids)
    - [Products by category](#products-by-category)
    - [Get all orders](#get-all-orders)
    - [Get an order info](#get-an-order-info)
    - [Create new order](#create-new-order)
- [API Exceptions](#api-exceptions)
    - [Wrong credentials](#wrong-credentials)
        - [example](#example)
    - [Products not available](#products-not-available)
        - [example](#example-1)
- [License](#license)

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

[](#installation)

Require via composer

```
composer require codebuglab/laravel-like4card
```

In `config/app.php` file

```
'providers' => [
  ...
  CodeBugLab\Like4Card\Like4CardServiceProvider::class,
];
```

Config
------

[](#config)

Add your info to `.env` file

```
LIKE4CARD_DEVICE_ID=xxx
LIKE4CARD_EMAIL=xxx
LIKE4CARD_PASSWORD=xxx
LIKE4CARD_SECURITY_CODE=xxx
LIKE4CARD_LANG_ID=xxx
```

The config file looks like

```
[
  'device_id' => env('LIKE4CARD_DEVICE_ID', null),
  'email' => env('LIKE4CARD_EMAIL', null),
  'password' => env('LIKE4CARD_PASSWORD', null),
  'security_code' => env('LIKE4CARD_SECURITY_CODE', null),
  'lang_id' => env('LIKE4CARD_LANG_ID', 1)
]
```

Available api methods
---------------------

[](#available-api-methods)

### Get merchant balance

[](#get-merchant-balance)

Operation that help the merchant to get his balance and user Id.

```
$response = Like4Card::balance();
```

`$response` is an Object with the following parameters

ParameterDescriptionresponse1 for success, 0 for failureuserIdmerchant account identifierbalancemerchant account balancecurrency### Categories

[](#categories)

Operation to get all categories available for this merchant.

```
$response = Like4Card::categories();
```

`$response` is an **Array** with the following parameters

ParameterDescriptionid-categoryParentId-categoryName-amazonImage-childsArray of sub-categories with same parent category structure### Products by products ids

[](#products-by-products-ids)

**There's an issue in API request param: This will only get the first ID**

Operation to get all products available by an array of products identifiers.

```
$product_ids = [1, 2, 3]; // required products ids
$response = Like4Card::products($product_ids);
```

`$response` is an **array**. Each element is an object with the following parameters

> When no products found: `$response` is a `string` with error message

ParameterDescriptionproductId-categoryId-productName-productImage-productCurrency-productPricethat represents the product price including vat that the merchant paid for productproductPriceWithoutVat-sellPricethat represents the price the customer pays for the product to the merchant.sellPriceWithoutVat-availabledetermines if stock for this product is available or not.optionalFieldsExist1 optional fields required, 0 there are no required optional fields.productOptionalFieldsarray of optional fields wherevatAmount-vatPercentage-**Each optional field has**

ParameterDescriptionididentifier of the optional fieldrequired'1' means it's required, '0' means it's optional and not requireddefaultValuedefault value for this fieldhintplaceholder for this fieldlabellabel displayed on top of this field on UIfieldTypeId1 plaintext ,7 email address, 10 phone number ,other number plaintextfieldCodeoptionsarray of choices in case option is multi choice field### Products by category

[](#products-by-category)

Operation to get all products available by category id.

```
$category_id = 1;
$response = Like4Card::getProductsByCategoryId($category_id);
```

`$response` is an **array**. Each element is an object with the following parameters.

> When no products found: `$response` is a `string` with error message

ParameterDescriptionproductId-categoryId-productName-productImage-productCurrency-productPricethat represents the product price including vat that the merchant paid for productproductPriceWithoutVat-sellPricethat represents the price the customer pays for the product to the merchant.sellPriceWithoutVat-availabledetermines if stock for this product is available or not.optionalFieldsExist1 optional fields required, 0 there are no required optional fields.productOptionalFieldsarray of optional fields wherevatAmount-vatPercentage-**Each optional field has**

ParameterDescriptionididentifier of the optional fieldrequired'1' means it's required, '0' means it's optional and not requireddefaultValuedefault value for this fieldhintplaceholder for this fieldlabellabel displayed on top of this field on UIfieldTypeId1 plaintext ,7 email address, 10 phone number ,other number plaintextfieldCodeoptionsarray of choices in case option is multi choice field### Get all orders

[](#get-all-orders)

Operation to get all orders made by this merchant. This api can receive the following options:

ParameterDescriptionpagepage number(default is 1), where page size is fixed value of 100 order per pageorder\_typedesc or asc, arranged by order create date orderCreateDatefromget all orders with create date bigger than this timestamptoget all orders with create date less than this timestamp```
// all options are not required
$options = [
  'page' => 1,
  'orderType' => 'asc',
  'from' => 1621327053,
  'to' => 1623998253
];
$response = Like4Card::orders($options);
```

`$response` is an Object with the following parameters

ParameterDescriptionorderNumber-orderFinalTotalrepresent the price the merchant will pay for LikeCard for this ordercurrencySymbol-orderCreateDate-orderCurrentStatus-orderPaymentMethod-### Get an order info

[](#get-an-order-info)

Operation to get one order details by its id.

```
$order_id = 1;
$response = Like4Card::order($order_id);
```

`$response` is an Object with the following parameters

ParameterDescriptionresponse1 for success, 0 for failureserialsarray of objects, each object represent a purchased product details.**each serial object has**

ParameterDescriptionserialCodeis the encrypted serial given to customer to be usedserialNumberis the card manufacturing NovalidTois the validation time for card### Create new order

[](#create-new-order)

Operation to create new order. This api can receive the following parameters:

ParameterDescriptionproduct\_idproduct identifier **Required**reference\_idmerchant reference **(Required and must be unique)**quantityalways 1```
$product_id = 1;
$local_id = 123; // the id from your local orders table

$response = Like4Card::createOrder($product_id, $local_id);
```

`$response` is an Object with the following parameters

ParameterDescriptionresponse1 for success, 0 for failureAPI Exceptions
--------------

[](#api-exceptions)

If the API response = 0, the service throws an exception. It could be one of the following exceptions

### Wrong credentials

[](#wrong-credentials)

It been thrown if you enter wrong deviceId, username, password or securityCode.

#### example

[](#example)

```
  try {
    $response = Like4Card::balance();
  } catch (\CodeBugLab\Like4Card\Exceptions\WrongCredentialsException $ex) {
    echo $ex->getMessage(); // "Incorrect Login - invalid email or password"
  }
```

### Products not available

[](#products-not-available)

It's been thrown if no products found with given **category id** or **products ids array**

#### example

[](#example-1)

```
  try {
    $data = Like4Card::getProductsByCategoryId(1);
  } catch (\CodeBugLab\Like4Card\Exceptions\ProductsNotFoundException $ex) {
    echo $ex->getMessage(); // "No available products"
  }
```

License
-------

[](#license)

Laravel Like4Card is a free software distributed under the terms of the MIT license.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

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

Total

5

Last Release

1812d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b739843a13277460d1b33db36cacdd3fe8c5c5942f458ed26284aba28c16849?d=identicon)[CodeBugLab](/maintainers/CodeBugLab)

![](https://www.gravatar.com/avatar/b287abe0508bd1591fc87a4d0b770a9545fe6033e9be97f1fcab4d5ec78753c6?d=identicon)[akhaled](/maintainers/akhaled)

---

Top Contributors

[![amrography](https://avatars.githubusercontent.com/u/9614340?v=4)](https://github.com/amrography "amrography (1 commits)")

---

Tags

laravellike4cardphpphpapilaravelgatewayonlineksaEgyptlike4card

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codebuglab-laravel-like4card/health.svg)

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

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[shipu/php-aamarpay-payment

PHP client for Aamarpay Payment Gateway API

3214.6k](/packages/shipu-php-aamarpay-payment)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)

PHPackages © 2026

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