Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.64 KB

README.md

File metadata and controls

60 lines (44 loc) · 1.64 KB

Country Select for Laravel Nova

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.