PHP code example of dcemal / filament-jsvectormap

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

    

dcemal / filament-jsvectormap example snippets


$table->json('target_countries')->nullable();

protected $casts = [
    'target_countries' => 'array',
];

use Dcemal\FilamentJsVectorMap\Forms\Components\MapSelect;

MapSelect::make('target_countries')
    ->label('Target countries');

use Dcemal\FilamentJsVectorMap\Infolists\Components\CountriesEntry;

CountriesEntry::make('target_countries')
    ->label('Target countries')
    ->showMap();   // or ->hideMap() to show only the flag badges

MapSelect::make('target_countries')
    ->label('Target countries')
    ->multiple()
    ->regions([
        'MENA'          => ['DZ','EG','MA','SA','AE','QA'],
        'Latin America' => ['BR','MX','AR','CL','CO'],
    ])
    ->selectedColor('#16a34a')
    ->tooltips()
    ->focusOnSelection();

MapSelect::make('target_countries')->assetsUrl('/vendor/jsvectormap');

MapSelect::make('target_countries')->map('world_merc')->assetsUrl('/vendor/jsvectormap');
bash
php artisan filament:assets
bash
php artisan migrate
bash
php artisan vendor:publish --tag="filament-jsvectormap-translations"