Skip to content

Laravel-Countries, is a package that contains everything you need to start a new project and have all countries, information and translations on hand. And all this optimized for Laravel 8 ,9 and now 10.

License

Notifications You must be signed in to change notification settings

lwwcas/laravel-countries

Repository files navigation

Hero Map

release size Packagist Downloads Packagist Stars Packagist License


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:

composer require lwwcas/laravel-countries

And get started with Artisan

php artisan w-countries:install

Usage

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

use  Lwwcas\LaravelCountries\Models\Country;

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

Testing With Pest Php

composer test

Credits

License

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