PHPackages                             melolucas/cnab\_php - 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. melolucas/cnab\_php

ActiveLibrary

melolucas/cnab\_php
===================

Projeto para criar arquivos de remessas e processar arquivos de retorno no formato CNAB

1.4.0(4y ago)0836PHPPHP &gt;=5.4.0

Since Jun 8Pushed 4y agoCompare

[ Source](https://github.com/melolucas/CnabPHP)[ Packagist](https://packagist.org/packages/melolucas/cnab_php)[ RSS](/packages/melolucas-cnab-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (29)Used By (0)

CnabPHP
=======

[](#cnabphp)

[![Join the chat at https://gitter.im/andersondanilo/CnabPHP](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/andersondanilo/CnabPHP?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://camo.githubusercontent.com/38918f63416569959c06b11fb76ea69fa7f4b314e83fc9e3c324b12d930d9848/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616e646572736f6e64616e696c6f2f436e61625048502e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/andersondanilo/CnabPHP)[![Latest Stable Version](https://camo.githubusercontent.com/fbdad030f7b3e9071d5d156b57571fef02278513da1ed5585fef47246b5a1b21/68747470733a2f2f706f7365722e707567782e6f72672f616e646572736f6e64616e696c6f2f636e61625f7068702f762f737461626c652e737667)](https://packagist.org/packages/andersondanilo/cnab_php)[![Latest Unstable Version](https://camo.githubusercontent.com/9f7de7941d0e3c9648fe399625a049fbafb8c82f00084fcbe2a6afef38a6e1c4/68747470733a2f2f706f7365722e707567782e6f72672f616e646572736f6e64616e696c6f2f636e61625f7068702f762f756e737461626c652e737667)](https://packagist.org/packages/andersondanilo/cnab_php)[![Code Climate](https://camo.githubusercontent.com/9385bba737d5a290cef0f30c333363ade06597bd46fdd6073bcc160392901da5/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f616e646572736f6e64616e696c6f2f436e61625048502f6261646765732f6770612e737667)](https://codeclimate.com/github/andersondanilo/CnabPHP)[![Test Coverage](https://camo.githubusercontent.com/29b94f25787d299b7a8d884560fb8b06fe40c61392171c9206ce17c8e24efd9b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f616e646572736f6e64616e696c6f2f436e61625048502f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/andersondanilo/CnabPHP/coverage)

Projeto para criar arquivos de remessas e processar arquivos de retorno no formato CNAB, utilizado nos bancos geralmente para boleto bancário.

Funcionalidades
---------------

[](#funcionalidades)

- Leitura e geração de arquivos de retorno e remessa nos formatos CNAB 240 e 400

BancoVersão da RemessaVersão do RetornoBanco do Brasil240 (Beta)240 e 400Bradesco240Caixa240240 e 400Itaú400400Santander240Instalação
----------

[](#instalação)

### Composer

[](#composer)

Se você já conhece o **Composer**, adicione a dependência abaixo à diretiva *"require"* no seu **composer.json**:

```
"andersondanilo/cnab_php": "1.3.*"

```

Como Usar
---------

[](#como-usar)

### Lendo um arquivo de Retorno

[](#lendo-um-arquivo-de-retorno)

```
$cnabFactory = new Cnab\Factory();
$arquivo = $cnabFactory->createRetorno('AQUI VAI O CAMINHO DO ARQUIVO DE RETORNO, EX: RET1010.RET');
$detalhes = $arquivo->listDetalhes();
foreach($detalhes as $detalhe) {
    if($detalhe->getValorRecebido() > 0) {
        $nossoNumero   = $detalhe->getNossoNumero();
        $valorRecebido = $detalhe->getValorRecebido();
        $dataPagamento = $detalhe->getDataOcorrencia();
        $carteira      = $detalhe->getCarteira();
        // você já tem as informações, pode dar baixa no boleto aqui
    }
}
```

### Criando um arquivo de remessa

[](#criando-um-arquivo-de-remessa)

Consulte na wiki:

Como Contribuir
---------------

[](#como-contribuir)

Você pode contribuir com testes (unitários ou manuais), ou adaptando o formato para outro banco através do projeto cnab\_yaml ([https://github.com/andersondanilo/cnab\_yaml](https://github.com/andersondanilo/cnab_yaml)) (que é utilizado pelo cnab\_php). [Leia a wiki](https://github.com/andersondanilo/CnabPHP/wiki)

O projeto está usando o Waffle para gerenciar o status da impleentação de novas remessas e retornos:

[![Stories in Ready](https://camo.githubusercontent.com/389b97b8353de20b39d7607b459d31c7e7bd209c6805b9a5c2149e3deac72372/68747470733a2f2f62616467652e776166666c652e696f2f616e646572736f6e64616e696c6f2f436e61625048502e706e673f6c6162656c3d7265616479267469746c653d5265616479)](http://waffle.io/andersondanilo/CnabPHP)

Licença
-------

[](#licença)

Este projeto esta sobre a licença MIT

###  Health Score

33

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 56% 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 ~113 days

Recently: every ~545 days

Total

26

Last Release

1479d ago

PHP version history (2 changes)1.1.0PHP &gt;=5.3.0

1.3.17PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![andersondanilo](https://avatars.githubusercontent.com/u/5572326?v=4)](https://github.com/andersondanilo "andersondanilo (70 commits)")[![jefersondaniel](https://avatars.githubusercontent.com/u/3521637?v=4)](https://github.com/jefersondaniel "jefersondaniel (29 commits)")[![FrankBruno](https://avatars.githubusercontent.com/u/4559864?v=4)](https://github.com/FrankBruno "FrankBruno (7 commits)")[![fabioginzel](https://avatars.githubusercontent.com/u/7377511?v=4)](https://github.com/fabioginzel "fabioginzel (5 commits)")[![mrprompt](https://avatars.githubusercontent.com/u/166088?v=4)](https://github.com/mrprompt "mrprompt (3 commits)")[![kayque](https://avatars.githubusercontent.com/u/1613762?v=4)](https://github.com/kayque "kayque (1 commits)")[![programadormarin](https://avatars.githubusercontent.com/u/684809?v=4)](https://github.com/programadormarin "programadormarin (1 commits)")[![rogeriopradoj](https://avatars.githubusercontent.com/u/443391?v=4)](https://github.com/rogeriopradoj "rogeriopradoj (1 commits)")[![ronyldo12](https://avatars.githubusercontent.com/u/3726579?v=4)](https://github.com/ronyldo12 "ronyldo12 (1 commits)")[![sandrobocon](https://avatars.githubusercontent.com/u/8063255?v=4)](https://github.com/sandrobocon "sandrobocon (1 commits)")[![alustau](https://avatars.githubusercontent.com/u/2944692?v=4)](https://github.com/alustau "alustau (1 commits)")[![viniciusss](https://avatars.githubusercontent.com/u/1016025?v=4)](https://github.com/viniciusss "viniciusss (1 commits)")[![felipph](https://avatars.githubusercontent.com/u/5093652?v=4)](https://github.com/felipph "felipph (1 commits)")[![filpgame](https://avatars.githubusercontent.com/u/5223937?v=4)](https://github.com/filpgame "filpgame (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![jdrumsmns](https://avatars.githubusercontent.com/u/39559783?v=4)](https://github.com/jdrumsmns "jdrumsmns (1 commits)")

---

Tags

boletoremessaretorno

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/melolucas-cnab-php/health.svg)

```
[![Health](https://phpackages.com/badges/melolucas-cnab-php/health.svg)](https://phpackages.com/packages/melolucas-cnab-php)
```

###  Alternatives

[andersondanilo/cnab_php

Projeto para criar arquivos de remessas e processar arquivos de retorno no formato CNAB

334257.4k2](/packages/andersondanilo-cnab-php)[andersondanilo/cnab_yaml

Especificação do formato Cnab240 e Cnab400 traduzida para Yaml

72277.4k6](/packages/andersondanilo-cnab-yaml)[openboleto/opencnabphp

Biblioteca multibanco para geração e leitura de arquivos Cnab de remessa e retorno

2096.7k](/packages/openboleto-opencnabphp)

PHPackages © 2026

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