### Initialize and Configure Banrisul Boleto Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/banrisul.md Use this method to set all boleto data using chained method calls. You can add more demonstrative descriptions or instructions after initial setup. ```php $banrisul = new Eduardokum\LaravelBoleto\Boleto\Banco\Banrisul; $banrisul->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(1) ->setAgencia(1111) ->setConta(22222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $banrisul->addDescricaoDemonstrativo('demonstrativo 4'); $banrisul->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Install Laravel Boleto via Composer Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/install.md Use this command to add the package to your project's dependencies. ```bash composer require "eduardokum/laravel-boleto" ``` -------------------------------- ### Create Banco do Brasil Boleto Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/bancobrasil.md Instantiate and configure a Banco do Brasil boleto object with all necessary fields. You can add more demonstratives or instructions after initial setup. ```php $bb = new Eduardokum\LaravelBoleto\Boleto\Banco\Bb; $bb->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(11) ->setAgencia(1111) ->setConvenio(1231237) ->setConta(22222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $bb->addDescricaoDemonstrativo('demonstrativo 4'); $bb->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Initialize Banrisul Boleto with Constructor Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/banrisul.md Alternatively, initialize the Banrisul boleto object by passing an array of configuration options directly to the constructor. This includes optional fields like multa, juros, and jurosApos. ```php $banrisul = new Eduardokum\LaravelBoleto\Boleto\Banco\Banrisul([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 1, 'agencia' => 1111, 'conta' => 22222, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Render Multiple Boletos to PDF Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/render.md Instantiate the `Pdf` renderer, add one or more Boleto instances using `addBoleto()` or `addBoletos()`, and then call `gerarBoleto()` to render. Options to show print dialog or hide instructions are available. ```php $pdf = new Eduardokum\LaravelBoleto\Boleto\Render\Pdf(); ``` ```php $pdf->addBoleto($boleto); ``` ```php $pdf->addBoletos([ $boleto1, $boleto2, $boleto3, ]); ``` ```php $pdf->showPrint(); ``` ```php $pdf->hideInstrucoes(); ``` ```php $pdf->gerarBoleto($dest = self::OUTPUT_STANDARD, $save_path = null); ``` -------------------------------- ### Configure Banco do Nordeste Boleto Object Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/banconordeste.md Instantiate and configure the Banco do Nordeste boleto object using method chaining. Ensure all mandatory fields and optional parameters are set before rendering. ```php $bnb = new Eduardokum\LaravelBoleto\Boleto\Banco\Bnb; $bnb->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(21) ->setAgencia(1111) ->setConta(22222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $bnb->addDescricaoDemonstrativo('demonstrativo 4'); $bnb->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Create Banco do Brasil Boleto with Constructor Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/bancobrasil.md Instantiate and configure a Banco do Brasil boleto object by passing all configuration options directly to the constructor. This includes optional fields like multa, juros, and jurosApos. ```php $bb = new Eduardokum\LaravelBoleto\Boleto\Banco\Bb([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 11, 'agencia' => 1111, 'convenio' => 1231237, 'conta' => 22222, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Instantiate and Configure Itaú Boleto Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/itau.md Set up an Itaú boleto object by chaining methods for configuration. You can add multiple demonstratives and instructions this way. Ensure all mandatory fields are provided. ```php $itau = new Eduardokum\LaravelBoleto\Boleto\Banco\Itau; $itau->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(109) ->setAgencia(1111) ->setConta(22222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $itau->addDescricaoDemonstrativo('demonstrativo 4'); $itau->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Configure Banco do Nordeste Boleto Object with Array Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/banconordeste.md Instantiate and configure the Banco do Nordeste boleto object by passing an associative array of configuration options. This method is a concise alternative to chaining setters. ```php $bnb = new Eduardokum\LaravelBoleto\Boleto\Banco\Bnb([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 21, 'agencia' => 1111, 'conta' => 22222, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Santander Retorno Instantiation and Processing Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Instantiate Santander for either 400 or 240 position CNAB formats and process the return file. ```php // 400 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400\Banco\Santander($argument) // 240 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240\Banco\Santander($argument) // To process the file $return->processar(); ``` -------------------------------- ### Render Multiple Boletos to HTML Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/render.md Instantiate the `Html` renderer, add one or more Boleto instances using `addBoleto()` or `addBoletos()`, and then call `gerarBoleto()` to render an HTML string. Options to show print dialog or hide instructions are available. `gerarCarne()` can be used for a 'carnê' format. ```php $html = new Eduardokum\LaravelBoleto\Boleto\Render\Html(); ``` ```php $html->addBoleto($boleto); ``` ```php $html->addBoletos([ $boleto1, $boleto2, $boleto3, ]); ``` ```php $html->showPrint(); ``` ```php $html->hideInstrucoes(); ``` ```php $html->gerarBoleto(); ``` ```php $html->gerarCarne(); ``` -------------------------------- ### Initialize Santander Boleto with Array Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/santander.md Instantiate a Santander boleto object by passing an array of configuration options to the constructor. This is a more concise way to set multiple properties at once. ```php $santander = new Eduardokum\LaravelBoleto\Boleto\Banco\Santander([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 101, 'codigoCliente' => 2222222, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Instantiate and Configure Bancoob Boleto Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/bancoob.md Use this method to set individual Boleto properties after instantiation. You can add more demonstratives or instructions using specific methods. ```php $bancoob = new Eduardokum\LaravelBoleto\Boleto\Banco\Bancoob; $bancoob->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(1) ->setAgencia(1111) ->setConvenio(1231237) ->setConta(22222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $bancoob->addDescricaoDemonstrativo('demonstrativo 4'); $bancoob->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Initialize HSBC Remessa (Set Properties) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/hsbc.md Instantiate the HSBC remessa class and set the beneficiario, carteira, agencia, conta, and contaDv properties. Supports both CNAB400 and CNAB240 formats. ```php // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Hsbc; // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Hsbc; $send->setBeneficiario($beneficiario) ->setCarteira('CSB') ->setAgencia(1111) ->setConta(222222) ->setContaDv(2); ``` -------------------------------- ### Initialize HSBC Remessa (Array Configuration) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/hsbc.md Initialize the HSBC remessa class by passing an array of configuration options, including beneficiario, carteira, agencia, conta, and contaDv. Supports both CNAB400 and CNAB240 formats. ```php $sendArray = [ 'beneficiario' => $beneficiario, 'carteira' => 'CSB', 'agencia' => 1111, 'conta' => 222222, 'contaDv' => 2, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Hsbc($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Hsbc($sendArray); ``` -------------------------------- ### Instantiate and Configure Bradesco Boleto Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/bradesco.md Use this method to set all the necessary data for a Bradesco boleto, including payer and beneficiary information, due date, value, and bank contract details. You can also add multiple demonstrative descriptions and instructions. ```php $bradesco = new Eduardokum\LaravelBoleto\Boleto\Banco\Bradesco; $bradesco->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira('09') ->setAgencia(1111) ->setConta(2222222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $bradesco->addDescricaoDemonstrativo('demonstrativo 4'); $bradesco->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Instantiate Bancoob Boleto with Array Configuration Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/bancoob.md This method allows for setting multiple Boleto properties at once during instantiation by passing an associative array. It includes options for multa, juros, and jurosApos. ```php $bancoob = new Eduardokum\LaravelBoleto\Boleto\Banco\Bancoob([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 1, 'agencia' => 1111, 'convenio' => 123123, 'conta' => 22222, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Instantiate Bradesco Boleto with Array Configuration Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/bradesco.md Alternatively, initialize the Bradesco boleto object by passing an array of configuration options to the constructor. This includes basic boleto details, payer and beneficiary, and optional fields like multa, juros, and jurosApos. ```php $bradesco = new Eduardokum\LaravelBoleto\Boleto\Banco\Bradesco([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => '09', 'agencia' => 1111, 'conta' => 2222222, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Bancoob Retorno Instantiation and Processing Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Instantiate Bancoob for either 400 or 240 position CNAB formats and process the return file. ```php // 400 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400\Banco\Bancoob($argument) // 240 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240\Banco\Bancoob($argument) // To process the file $return->processar(); ``` -------------------------------- ### Retorno Argument Formats Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md The Retorno constructor accepts the file path as a string, the file content as a string, or the file content as an array of strings. ```php // File path $argument = '/path/to/retorno.ret'; ``` ```php // Or, String content $argument = '0RETORNOCONTENTHERE...\n1RETORNOCONTENTHERE...'; ``` ```php // Or, Array content $argument = [ '0RETORNOCONTENTHERE...', '1RETORNOCONTENTHERE...' ]; ``` -------------------------------- ### HSBC Retorno Instantiation and Processing Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Instantiate HSBC for either 400 or 240 position CNAB formats and process the return file. ```php // 400 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400\Banco\Hsbc($argument) // 240 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240\Banco\Hsbc($argument) // To process the file $return->processar(); ``` -------------------------------- ### Instantiate Banco do Brasil Remessa (Cnab400/Cnab240) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/bancobrasil.md Instantiate the Banco do Brasil Remessa class for either 400 or 240 positions and set beneficiary details. Use this when you prefer to set individual properties. ```php // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Bb; // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Bb; $send->setBeneficiario($beneficiario) ->setCarteira(11) ->setAgencia(1111) ->setConvenio(1231237) // ->setVariacaoCarteira(017) ->setConta(22222); ``` -------------------------------- ### Sicredi Retorno Instantiation and Processing Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Instantiate Sicredi for either 400 or 240 position CNAB formats and process the return file. ```php // 400 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400\Banco\Sicredi($argument) // 240 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240\Banco\Sicredi($argument) // To process the file $return->processar(); ``` -------------------------------- ### Instantiate Banco do Brasil Remessa with Array (Cnab400/Cnab240) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/bancobrasil.md Instantiate the Banco do Brasil Remessa class for either 400 or 240 positions using an array of configuration options. This is a more concise way to set up the remittance object. ```php $sendArray = [ 'beneficiario' => $beneficiario, 'carteira' => 11, 'agencia' => 1111, 'convenio' => 1231237, // 'variacaoCarteira' => '017', 'conta' => 22222, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Bb($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Bb($sendArray); ``` -------------------------------- ### Initialize Sicredi Boleto with Method Chaining Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/sicredi.md Use this method to set individual boleto properties using method chaining after instantiating the Sicredi class. It allows for flexible configuration of all required and optional fields. ```php $sicredi = new Eduardokum\LaravelBoleto\Boleto\Banco\Sicredi; $sicredi->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(1) ->setPosto(11) ->setByte(2) ->setAgencia(1111) ->setConta(22222) ->setCodigoCliente(12345) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $sicredi->addDescricaoDemonstrativo('demonstrativo 4'); $sicredi->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Configure HSBC Boleto with Constructor Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/hsbc.md Initialize an HSBC boleto object using an array of configuration options in the constructor. This method allows setting all parameters, including optional ones like multa, juros, and jurosApos, at once. ```php $hsbc = new Eduardokum\LaravelBoleto\Boleto\Banco\Hsbc([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 'CSB', 'agencia' => 1111, 'conta' => 222222, 'contaDv' => 2, 'range' => 99999, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Instantiate Bradesco Remessa with Array (CNAB400/CNAB240) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/bradesco.md Instantiate the Bradesco remessa class for either CNAB400 or CNAB240 format using an array of configuration options. This method simplifies the initialization process. ```php $sendArray = [ 'beneficiario' => $beneficiario, 'idremessa' => 1, 'carteira' => '09', 'agencia' => 1111, 'codigoCliente' => 12345678901234567890, 'conta' => 2222222, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Bradesco($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Bradesco($sendArray); ``` -------------------------------- ### Initialize Sicredi Remessa with Array Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/sicredi.md Instantiate the Sicredi remessa object for either 400 or 240 positions by passing an array of mandatory fields. Ensure the Beneficiario object is included in the array. ```php $sendArray = [ 'beneficiario' => $beneficiario, 'idremessa' => 1, 'carteira' => 1, 'agencia' => 1111, 'conta' => 22222, 'codigoCliente' => 12345, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Sicredi($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Sicredi($sendArray); ``` -------------------------------- ### Create Beneficiário with constructor array Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/beneficiario.md Instantiate the Pessoa object and pass an associative array of Beneficiário properties to the constructor. This is a more concise way to initialize the Beneficiário object. ```php $beneficiario = new Eduardokum LaravelBoleto Pessoa([ 'documento' => '00.000.000/0000-00', 'nome' => 'Company co.', 'cep' => '00000-000', 'endereco' => 'Street name, 123', 'bairro' => 'district', 'uf' => 'UF', 'cidade' => 'City', ]); ``` -------------------------------- ### Instantiate Caixa Remessa Object Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/caixa.md Instantiate the Caixa Remessa object for either 400 or 240 positions and set mandatory fields. Ensure the Beneficiario object is properly configured. ```php // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Caixa; // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Caixa; $send->setBeneficiario($beneficiario) ->setIdremessa(1) ->setCarteira('RG') ->setAgencia(1111) ->setCodigoCliente(222222); ``` ```php $sendArray = [ 'beneficiario' => $beneficiario, 'idremessa' => 1, 'carteira' => 'RG', 'agencia' => 1111, 'codigoCliente' => 222222, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Caixa($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Caixa($sendArray); ``` -------------------------------- ### Initialize Santander Boleto Object Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/santander.md Instantiate a Santander boleto object and set its properties using setter methods. This method allows for step-by-step configuration. ```php $santander = new Eduardokum\LaravelBoleto\Boleto\Banco\Santander; $santander->setLogo('/path/to/logo.png') ->setDataVencimento('1997-10-07') ->setValor('100') ->setNumero(1) ->setNumeroDocumento(1) ->setPagador($pagador) ->setBeneficiario($beneficiario) ->setCarteira(101) ->setCodigoCliente(2222222) ->setDescricaoDemonstrativo(['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3']) ->setInstrucoes(['instrucao 1', 'instrucao 2', 'instrucao 3']); // You can add more ``Demonstrativos`` or ``Instrucoes`` on this way: $santander->addDescricaoDemonstrativo('demonstrativo 4'); $santander->addInstrucoes('instrucao 2'); ``` -------------------------------- ### Banrisul Retorno Instantiation and Processing Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Instantiate Banrisul for either 400 or 240 position CNAB formats and process the return file. ```php // 400 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400\Banco\Banrisul($argument) // 240 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240\Banco\Banrisul($argument) // To process the file $return->processar(); ``` -------------------------------- ### Instantiate Itaú Remessa with Array (Cnab400/Cnab240) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/itau.md Instantiate the Itaú Remessa class for either 400 or 240 positions using an array of configuration options. This method simplifies the initialization process. ```php $sendArray = [ 'beneficiario' => $beneficiario, 'carteira' => 109, 'agencia' => 1111, 'conta' => 22222, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Itau($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Itau($sendArray); ``` -------------------------------- ### Initialize Sicredi Boleto with Constructor Array Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/sicredi.md This approach initializes the Sicredi boleto object by passing an associative array of configuration options directly to the constructor. It's a concise way to set multiple properties at once, including optional fields like multa, juros, and jurosApos. ```php $sicredi = new Eduardokum\LaravelBoleto\Boleto\Banco\Sicredi([ 'logo' => '/path/to/logo.png', 'dataVencimento' => '1997-10-07', 'valor' => 100, 'numero' => 1, 'numeroDocumento' => 1, 'pagador' => $pagador, 'beneficiario' => $beneficiario, 'carteira' => 1, 'posto' => 11, 'byte' => 2, 'agencia' => 1111, 'conta' => 22222, 'codigoCliente' => 12345, 'multa' => 1, // 1% do valor do boleto após o vencimento 'juros' => 1, // 1% ao mês do valor do boleto 'jurosApos' => 0 // quant. de dias para começar a cobrança de juros, 'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'], 'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'], ]); ``` -------------------------------- ### Render Boleto Individually (PDF) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/render.md Renders a single Boleto object into a PDF string. Optional parameters control whether a print window is shown and if instructions are included. ```APIDOC ## Render Boleto Individually (PDF) ### Description Renders a single Boleto object into a PDF string. Optional parameters control whether a print window is shown and if instructions are included. ### Method Signature `renderPDF($print = false, $instrucoes = true)` ### Parameters - **$print** (bool) - Optional - If true, shows a print window after rendering. - **$instrucoes** (bool) - Optional - If true, includes print instructions. ### Usage Examples ```php // Generate a PDF string $boleto->renderPDF(); // Show a print window after rendering $boleto->renderPDF(true); // Hide print instructions $boleto->renderPDF(false, false); ``` ``` -------------------------------- ### Initialize Sicredi Remessa Object Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/sicredi.md Instantiate the Sicredi remessa object for either 400 or 240 positions and set mandatory fields using setter methods. Ensure the Beneficiario object is set. ```php // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Sicredi; // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Sicredi; $send->setBeneficiario($beneficiario) ->setIdremessa(1) ->setCarteira(1) ->setAgencia(1111) ->setConta(22222) ->setCodigoCliente(12345); ``` -------------------------------- ### Accessing Return Details (240 Positions) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md For 240-position returns, access iterable details, header information, header information by lote, totals, and totals by lote using `getDetalhes()`, `getHeader()`, `getHeaderLote()`, `getTrailer()`, and `getTrailerLote()`. Iterate through details using `foreach` and `toArray()`. ```php // This will return a iterable object, with all returns $return->getDetalhes(); // This will return a object with information $return->getHeader(); // This will return a object with information by lote $return->getHeaderLote(); // This will return a object with totals information $return->getTrailer(); // This will return a object with totals information by lote $return->getTrailerLote(); // To iterate do: foreach($return->getDetalhes() as $object) { var_dump($object->toArray()); } ``` -------------------------------- ### Create Pagador using Constructor Array Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/pagador.md Instantiate the Pessoa object and initialize payer details by passing an associative array to the constructor. This provides a more concise way to set all attributes at once. ```php $pagador = new Eduardokum\LaravelBoleto\Pessoa([ 'documento' => '00.000.000/0000-00', 'nome' => 'Company co.', 'cep' => '00000-000', 'endereco' => 'Street name, 123', 'bairro' => 'district', 'uf' => 'UF', 'cidade' => 'City', ]); ``` -------------------------------- ### Render Boleto Individually (HTML) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/render.md Renders a single Boleto object into an HTML string. Optional parameters control whether a print window is shown and if instructions are included. ```APIDOC ## Render Boleto Individually (HTML) ### Description Renders a single Boleto object into an HTML string. Optional parameters control whether a print window is shown and if instructions are included. ### Method Signature `renderHTML($print = false, $instrucoes = true)` ### Parameters - **$print** (bool) - Optional - If true, shows a print window after rendering. - **$instrucoes** (bool) - Optional - If true, includes print instructions. ### Usage Examples ```php // Generate an HTML string $boleto->renderHTML(); // Show a print window after rendering $boleto->renderHTML(true); // Hide print instructions $boleto->renderHTML(false, false); ``` ``` -------------------------------- ### Render Multiple Boletos (PDF) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/boleto/render.md Renders multiple Boleto objects into a PDF. This involves instantiating the Pdf renderer, adding boletos, and then generating the PDF with various output options. ```APIDOC ## Render Multiple Boletos (PDF) ### Description Renders multiple Boleto objects into a PDF. This involves instantiating the Pdf renderer, adding boletos, and then generating the PDF with various output options. ### Class `Eduardokum\LaravelBoleto\Boleto\Render\Pdf` ### Methods - `addBoleto(Boleto $boleto)`: Adds a single Boleto object to the renderer. - `addBoletos(array $boletos)`: Adds an array of Boleto objects to the renderer. - `showPrint()`: Configures the renderer to show a print window after rendering. - `hideInstrucoes()`: Configures the renderer to hide print instructions. - `gerarBoleto($dest = self::OUTPUT_STANDARD, $save_path = null)`: Generates the PDF with specified destination and optional save path. ### PDF Destinations - `Pdf::OUTPUT_STANDARD`: Returns a PDF with headers. - `Pdf::OUTPUT_DOWNLOAD`: Forces download of the PDF. - `Pdf::OUTPUT_SAVE`: Saves the PDF on disk (requires `save_path`). - `Pdf::OUTPUT_STRING`: Returns the PDF as a string. ### Usage Examples ```php $pdf = new Eduardokum\LaravelBoleto\Boleto\Render\Pdf(); // Add a single boleto $pdf->addBoleto($boleto); // Add multiple boletos $pdf->addBoletos([ $boleto1, $boleto2, $boleto3, ]); // Configure rendering options $pdf->showPrint(); $pdf->hideInstrucoes(); // Generate and output the PDF (e.g., as a string) $pdfOutput = $pdf->gerarBoleto(Eduardokum\LaravelBoleto\Boleto\Render\Pdf::OUTPUT_STRING); ``` ``` -------------------------------- ### Banco do Brasil Retorno Instantiation and Processing Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Instantiate Banco do Brasil (Bb) for either 400 or 240 position CNAB formats and process the return file. ```php // 400 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab400\Banco\Bb($argument) // 240 positions $return = new Eduardokum\LaravelBoleto\Cnab\Retorno\Cnab240\Banco\Bb($argument) // To process the file $return->processar(); ``` -------------------------------- ### Accessing Return Details (400 Positions) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/retorno/index.md Use `getDetalhes()`, `getHeader()`, and `getTrailer()` to access iterable details, header information, and totals respectively for 400-position returns. Iterate through details using `foreach` and `toArray()`. ```php // This will return a iterable object, with all returns $return->getDetalhes(); // This will return a object with information $return->getHeader(); // This will return a object with totals information $return->getTrailer(); // To iterate do: foreach($return->getDetalhes() as $object) { var_dump($object->toArray()); } ``` -------------------------------- ### Create Pagador using Setter Methods Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/pagador.md Instantiate the Pessoa object and set payer details using individual setter methods. This approach is useful when building the object incrementally. ```php $pagador = new Eduardokum\LaravelBoleto\Pessoa; $pagador->setDocumento('00.000.000/0000-00') ->setNome('Company co.') ->setCep('00000-000') ->setEndereco('Street name, 123') ->setBairro('district') ->setUf('UF') ->setCidade('City'); ``` -------------------------------- ### Instantiate Banrisul Remessa (400/240 positions) Source: https://github.com/eduardokum/laravel-boleto/blob/master/docs/source/usage/remessa/banrisul.md Instantiate the Banrisul remittance class for either 400 or 240 positions. Set beneficiary and account details. ```php // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Banrisul; // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Banrisul; $send->setBeneficiario($beneficiario) ->setCarteira(1) ->setAgencia(1111) ->setCodigoCliente(1234567) // ->setCodigoClienteOfficeBanking(1234567890) ->setConta(22222); ``` ```php $sendArray = [ 'beneficiario' => $beneficiario, 'carteira' => 1, 'agencia' => 1111, 'codigoCliente' => 1234567, // 'codigoClienteOfficeBanking' => '1234567890', 'conta' => 22222, ]; // for 400 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Banrisul($sendArray); // Or, for 240 positions $send = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab240\Banco\Banrisul($sendArray); ```