PHPackages                             akhaled/select-country - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. akhaled/select-country

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

akhaled/select-country
======================

Select country with Select2

0.0.2(5y ago)024MITPHP

Since Dec 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/akhled/country-select)[ Packagist](https://packagist.org/packages/akhaled/select-country)[ RSS](/packages/akhaled-select-country/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Select2 countries list
=======================

[](#select2-countries-list-)

Laravel package to select countries single or multiple using [select2](https://select2.org/).

- [Installation](#installation)
- [How to use](#how-to-use)
- [Events](#events)

Installation
------------

[](#installation)

`composer require akhaled/select-country`

Then add `Akhaled\SelectCountry\ServiceProvider::class` to `config/app.php` providers

How to use
----------

[](#how-to-use)

### 1. Add the component to your view

[](#1-add-the-component-to-your-view-)

```
{{-- Single selection --}}

{{-- Multiple selection --}}

```

### 2. Add scripts

[](#2-add-scripts-)

```
{{-- link-to-jquery --}

@selectCountryScripts
```

### 3. Add select2 style

[](#3-add-select2-style-)

```

```

Events
------

[](#events)

You can use [select2 event](https://select2.org/programmatic-control/events) by listening to element class `.akhaled-select-country`

### example

[](#example-)

```

    $(document).delegate('.akhaled-select-country', 'select2:select', function(e) {
        let country = $(e.params.data.element).data('country')
        $('#country-code').text(`+${country.calling_code}`);
    });

```

> The option is linked with data-country attribute that's contain more information about the country. [See more](https://github.com/rinvex/countries)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

2

Last Release

1973d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b287abe0508bd1591fc87a4d0b770a9545fe6033e9be97f1fcab4d5ec78753c6?d=identicon)[akhaled](/maintainers/akhaled)

### Embed Badge

![Health badge](/badges/akhaled-select-country/health.svg)

```
[![Health](https://phpackages.com/badges/akhaled-select-country/health.svg)](https://phpackages.com/packages/akhaled-select-country)
```

###  Alternatives

[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
