2017 © Pedro Peláez
 

laravel-package countries

A simple Laravel package to handle country lists

image

aheenam/countries

A simple Laravel package to handle country lists

  • Thursday, August 17, 2017
  • by rathesDot
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Countries

This package is a Laravel Wrapper for the country-list package by Saša Stamenković. It was created as a fallback to antonioribeiro/countries which has PHP 7 and Laravel 5.3 as it minimum requirements., (*1)

Note: that this package does NOT contain the whole functionality as antonioribeiro/countries but only provides the name of the countries, (*2)


Installation

You can install the package via composer:, (*3)

$ composer require aheenam/laravel-translatable

Then add the service provider must be registered:, (*4)

// config/app.php
'providers' => [
    // ...
    Aheenam\Countries\CountriesServiceProvider::class,
];

Also add Countries to your aliases list, (*5)

// config/app.php
'aliases' => [
    // ...
    'Countries' => \Aheenam\Countries\Facades\Countries::class,
];

Usage

There are not that much methods for now. If you are interested in more, feel free to add them and send us a PR., (*6)

Get All Countries

<?php

Countries::all();

returns a list of all countries in all languages currently loaded. By default the current language set in App::setLocale() is populated., (*7)

If you want to get the countries in another language, use, (*8)

<?php
App::setLocale('en'):
$countries = Countries::allIn();
$countries->get('en'); // returns a collection with all countries in English

Get A specific country

To get a specific country call the get() method with the language key, you are looking for, (*9)

<?php
App::setLocale('en'):
Countries::get('de'); // returns "Germany"

If you want to get the language in a specific language, just add the language code as the second parameter., (*10)

<?php
App::setLocale('en'):
Countries::get('de', 'de'); // returns "Deutschland"

Changelog

Check CHANGELOG for the changelog, (*11)

Testing

To run tests use, (*12)

$ composer test

or, (*13)

$ composer test:windows

on windows machines., (*14)

Contributing

soon, (*15)

Security

If you discover any security related issues, please email rathes@aheenam.com or use the issue tracker of GitHub., (*16)

About Aheenam

Aheenam is a small company from NRW, Germany creating custom digital solutions. Visit our website to find out more about us., (*17)

License

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

The Versions

17/08 2017

dev-master

9999999-dev

A simple Laravel package to handle country lists

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rathes Sachchithananthan

17/08 2017

v1.0.1

1.0.1.0

A simple Laravel package to handle country lists

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rathes Sachchithananthan

17/08 2017

v1.0.0

1.0.0.0

A simple Laravel package to handle country lists

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rathes Sachchithananthan