enmaboya/country-select

A Laravel Nova field.

1.0 2021-09-07 12:29 UTC

This package is auto-updated.

Last update: 2024-04-07 18:20:29 UTC


README

This package provides a customizable select field.

Installation

composer require enmaboya/country-select

Basic usage

use Enmaboya\CountrySelect\CountrySelect;
	
CountrySelect::make('Country', 'county_code')

Available settings

  1. only - only countries from the list will be displayed

use Enmaboya\CountrySelect\CountrySelect;
   
CountrySelect::make('Country', 'county_code')->only(['US', 'RU'])
  1. except - excludes countries from the list

use Enmaboya\CountrySelect\CountrySelect;
   
CountrySelect::make('Country', 'county_code')->except(['BY', 'CN'])
  1. onlyContinents - only сontinents from the list will be displayed

use Enmaboya\CountrySelect\CountrySelect;
  
CountrySelect::make('Country', 'county_code')->onlyContinents(['EU', 'AS'])
  1. exceptContinents - excludes сontinents from the list

use Enmaboya\CountrySelect\CountrySelect;
   
CountrySelect::make('Country', 'county_code')->exceptContinents(['SA', 'NA', 'OC'])

Available list of continents:

  • AF - Africa
  • AS - Asia
  • EU - Europe
  • NA - North America
  • OC - Oceania
  • SA - South America

Make the field dependent

You can make this field dependent and use it together with the "Laravel Nova Place Input field".

In this case the search will be limited to the country selected in the "Select Country field".

License

The MIT License (MIT). Please see License File for more information.