PHPackages                             chalcedonyt/laravel-cos-processor - 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. chalcedonyt/laravel-cos-processor

ActiveLibrary

chalcedonyt/laravel-cos-processor
=================================

Provides functionality to upload COS (Cheque Outsourcing Services) files.

02.1k2PHP

Since Oct 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/chalcedonyt/laravel-cos-processor)[ Packagist](https://packagist.org/packages/chalcedonyt/laravel-cos-processor)[ RSS](/packages/chalcedonyt-laravel-cos-processor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

COS Processor for Laravel
=========================

[](#cos-processor-for-laravel)

Helper functions to deal with COS (Cheque Outsourcing Services). Generates files based on payment entries. UOB and HSBC supported at the moment. Look at the files under the documentation/ folder for the original documents from UOB and HSBC.

Install
-------

[](#install)

Via Composer

```
$ composer require chalcedonyt/laravel-cos-processor
```

Creating an Adapter
-------------------

[](#creating-an-adapter)

Create an adapter that implements `Chalcedonyt\\COSProcessor\\Adapter\\BeneficiaryAdapterInterface`. This should translate your model into the attributes that will be used in the COS entries. Refer to `Chalcedonyt\\COSProcessor\\Adapter\\ExampleBeneficiaryAdapter` for an example.

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

[](#configuration)

`php artisan vendor:publish` should publish a `cos_processor.php` into the config folder. Edit this with the configuration options for your account. Change `"beneficiary_adapter"` to the class of the adapter you created earlier.

Usage - Generating a file to upload
-----------------------------------

[](#usage---generating-a-file-to-upload)

Call the relevant COSUploadProcessorFactory subclass and pass in your data, and the config key.

```
$beneficiaries = TestPayment::all();
$cos = HSBCCOSUploadProcessorFactory::createCsvString($beneficiaries, 'cos_processor.hsbc_example');
echo $cos;
```

Usage - Processing a result file from HSBC
------------------------------------------

[](#usage---processing-a-result-file-from-hsbc)

HSBC COS will return a csv file with the results of a COS upload. Refer to `tests/ifile_result.csv` for an example. You can process this file into an array of `COSResult` with the following code:

```
//the first line is the Header
$handle = fopen( __DIR__ ."/ifile_result.csv", "r");
$index = 0;
$results = [];
while (($line = fgets($handle)) !== false) {
    if( $index++ !== 0){
        $adapter = new HSBCCOSResultAdapter($line);
        $results[] = $adapter -> getCosResult();
    }
}
fclose($handle);
```

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ff150ccb744dbada2b6373b324071abc871ba07fc3334ece55860c35d36d124?d=identicon)[chalcedonyt](/maintainers/chalcedonyt)

---

Top Contributors

[![timothythteoh](https://avatars.githubusercontent.com/u/7899530?v=4)](https://github.com/timothythteoh "timothythteoh (19 commits)")[![chalcedonyt](https://avatars.githubusercontent.com/u/3726096?v=4)](https://github.com/chalcedonyt "chalcedonyt (1 commits)")

### Embed Badge

![Health badge](/badges/chalcedonyt-laravel-cos-processor/health.svg)

```
[![Health](https://phpackages.com/badges/chalcedonyt-laravel-cos-processor/health.svg)](https://phpackages.com/packages/chalcedonyt-laravel-cos-processor)
```

PHPackages © 2026

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