PHP code example of jeffersongoncalves / filament-cep-field

1. Go to this page and download the library: Download jeffersongoncalves/filament-cep-field library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeffersongoncalves / filament-cep-field example snippets


use JeffersonGoncalves\Filament\CepField\Forms\Components\CepInput;

// Basic usage
CepInput::make('cep')
    -> 'prefix' or 'suffix' (default: 'suffix')
    ->setActionLabel('Buscar CEP') // Custom search button label
    ->setActionLabelHidden(false) // Show/hide action label (default: false)
    ->setErrorMessage('CEP não encontrado.') // Custom error message
    ->setStreetField('street') // Field to populate with street name
    ->setNeighborhoodField('neighborhood') // Field to populate with neighborhood
    ->setCityField('city') // Field to populate with city name
    ->setStateField('state'), // Field to populate with state

CepInput::make('postal_code')
    ->label('CEP')
    ->

CepInput::make('cep')
    ->label('CEP')
    ->hborhoodField('bairro')
    ->setCityField('cidade')
    ->setStateField('estado')

CepInput::make('cep')
    ->label('Código Postal')
    ->setMode('prefix')
    ->setActionLabel('Consultar')
    ->setActionLabelHidden(false)
    ->setErrorMessage('CEP não encontrado ou inválido.')

// Test SSL connection
$response = file_get_contents('https://brasilapi.com.br/api/cep/v1/01310100');
if ($response !== false) {
    echo "SSL configuration is working correctly!";
} else {
    echo "SSL configuration needs attention.";
}

   Http::withOptions([
       'verify' => '/path/to/cacert.pem'
   ])->get('https://api.example.com');
   
bash
php artisan vendor:publish --tag=cep-migrations
php artisan migrate
ini
; Enable SSL certificate verification
openssl.cafile = "C:\php\extras\ssl\cacert.pem"  ; Windows path
; openssl.cafile = "/etc/ssl/certs/cacert.pem"   ; Linux/macOS path

; For cURL specifically
curl.cainfo = "C:\php\extras\ssl\cacert.pem"     ; Windows path
; curl.cainfo = "/etc/ssl/certs/cacert.pem"      ; Linux/macOS path