PHP code example of fadlee / filament-indonesia-region-field

1. Go to this page and download the library: Download fadlee/filament-indonesia-region-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/ */

    

fadlee / filament-indonesia-region-field example snippets


use Fadlee\FilamentIndonesiaRegionField\Forms\Components\IndonesiaRegionSelect;
use Fadlee\FilamentIndonesiaRegionField\Enums\RegionLevel;

public static function form(Form $form): Form
{
    return $form
        ->schema([
            IndonesiaRegionSelect::make('region')
                ->label('Region')
                ->placeholder('Select region...'),
            // ... other fields
        ]);
}

public static function form(Form $form): Form
{
    return $form
        ->schema([
            IndonesiaRegionSelect::make('region')
                ->label('Region')
                ->level(RegionLevel::LEVEL_3_DISTRICT)
                ->placeholder('Select district...'),
        ]);
}

use Filament\Actions\Action;

public static function getActions(): array
{
    return [
        Action::make('selectRegion')
            ->form([
                IndonesiaRegionSelect::make('region')
                    ->label('Select Region')
                    ->