1. Go to this page and download the library: Download brew/brazil-locations 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/ */
brew / brazil-locations example snippets
use App\Models\State;
$states = State::orderBy('name')->get();
use App\Models\City;
$city = City::where('ibge_code', '3509502')->first();
$state = $city->state; // São Paulo
$states = State::with('cities')->get();
use App\Models\City;
use App\Models\State;
use Filament\Forms\Components\Select;
use Filament\Forms\Get;
Select::make('state_id')
->label('State')
->options(State::orderBy('name')->pluck('name', 'id'))
->live()
->
use App\Models\State;
$states = State::orderBy('name')->get();
use App\Models\City;
$city = City::where('ibge_code', '3509502')->first();
$state = $city->state; // São Paulo
$states = State::with('cities')->get();
use App\Models\City;
use App\Models\State;
use Filament\Forms\Components\Select;
use Filament\Forms\Get;
Select::make('state_id')
->label('Estado')
->options(State::orderBy('name')->pluck('name', 'id'))
->live()
->