PHP code example of otavio-araujo / filament-smart-cep
1. Go to this page and download the library: Download otavio-araujo/filament-smart-cep 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/ */
otavio-araujo / filament-smart-cep example snippets
public static function configure(Schema $schema): Schema
{
return $schema
->components([
SmartCep::make('postal_code'),
TextInput::make('street'),
TextInput::make('neighborhood'),
TextInput::make('city'),
TextInput::make('state'),
TextInput::make('state_code'),
TextInput::make('ibge_code'),
TextInput::make('country'),
TextInput::make('country_code'),
TextInput::make('number'),
]);
}
public static function configure(Schema $schema): Schema
{
return $schema
->components([
SmartCep::make('postal_code')
->bindStreetField('custom_street')
->bindNeighborhoodField('custom_neighborhood')
->bindCityField('custom_city')
->bindStateField('custom_state')
->bindStateCodeField('custom_state_code')
->bindIbgeCodeField('custom_ibge_code')
->bindCountryField('custom_country')
->bindCountryCodeField('custom_country_code'),
TextInput::make('custom_street'),
TextInput::make('custom_neighborhood'),
TextInput::make('custom_city'),
TextInput::make('custom_state'),
TextInput::make('custom_state_code'),
TextInput::make('custom_ibge_code'),
TextInput::make('custom_country'),
TextInput::make('custom_country_code'),
TextInput::make('number'),
]);
}
public static function configure(Schema $schema): Schema
{
return $schema
->components([
SmartCep::make('postal_code')
->actionIcon(Heroicon::OutlinedDocumentMagnifyingGlass), // Default: Heroicon::OutlinedMagnifyingGlass
->actionPosition('prefix') // Options: 'prefix', 'suffix' | Default: 'suffix'
]);
}
public static function configure(Schema $schema): Schema
{
return $schema
->components([
SmartCep::make('postal_code')
->nextFocusField('number'),
...
TextInput::make('number'),
]);
}
bash
composer analyse