An open API service indexing awesome lists of open source software.

https://github.com/lwwcas/laravel-countries

A comprehensive package for managing country data in Laravel applications, including multilingual support, geographic coordinates, and detailed metadata for seamless integration with Laravel.
https://github.com/lwwcas/laravel-countries

arabic countries country country-codes country-flags database dutch english german italian laravel migrations php portuguese portuguese-brazilian portuguese-portugal regions russian seeds spanish

Last synced: 2 months ago
JSON representation

A comprehensive package for managing country data in Laravel applications, including multilingual support, geographic coordinates, and detailed metadata for seamless integration with Laravel.

Awesome Lists containing this project

README

          


Hero Map


release

size

Packagist Downloads

Packagist Stars

Packagist License

### [Full Documentation](https://lwwcas.github.io/laravel-countries/)


## Very short description


My Logo

Laravel Countries is a package that provides everything you need to kickstart a new project with comprehensive country information, including translations. Optimized for Laravel, it ensures efficient access and management of country data.

The package stores all data directly in your database, allowing you to easily link it to any other table in a simple and familiar way using Laravelโ€™s Eloquent ORM.

## ๐ŸŒ Available Languages

We currently support the following languages:

| Language | Flag | Country | Number of Countries |
|---------------|------|--------------|---------------------|
| Arabic | ๐Ÿ‡ธ๐Ÿ‡ฆ | Saudi Arabia | 25 |
| Dutch | ๐Ÿ‡ณ๐Ÿ‡ฑ | Netherlands | 3 |
| English | ๐Ÿ‡ฌ๐Ÿ‡ง | United Kingdom| 67 |
| German | ๐Ÿ‡ฉ๐Ÿ‡ช | Germany | 6 |
| Italian | ๐Ÿ‡ฎ๐Ÿ‡น | Italy | 4 |
| Portuguese | ๐Ÿ‡ง๐Ÿ‡ท | Brazil | 9 |
| Russian | ๐Ÿ‡ท๐Ÿ‡บ | Russia | 4 |
| Spanish | ๐Ÿ‡ช๐Ÿ‡ธ | Spain | 21 |

## ๐Ÿš€ Getting Started

Install the package quickly via Composer:

```sh
composer require lwwcas/laravel-countries
```

And get started with Artisan

```sh
php artisan w-countries:install
```

## Usage

You can access all the information in the database with a simple query

``` php
use Lwwcas\LaravelCountries\Models\Country;

Country::whereIso('BR')->first();
Country::whereIsoAlpha3('BRA')->first();
Country::whereSlug('brasil')->first();
```

### Testing With Pest Php

``` bash
composer test
```

## Credits

- [Lucas Duarte](https://github.com/lwwcas)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.