Introduction

A Laravel package for working with Countries.

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

Installation

Via Composer

composer require dcblogdev/laravel-countries

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

'providers' => [
    // ...
    Dcblogdev\Countries\CountriesServiceProvider::class,
];

Usage

In a controller import the class:

use Dcblogdev\Countries\Facades\Countries;

In a view or closure call the facade:

This will return an object of countries

Countries::all();

 

Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.