Code Monkey home page Code Monkey logo

laravel-countries's Introduction

Laravel Countries

Total Downloads Latest Stable Version Latest Unstable Version

Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.

Please note that version 1.4 is Laravel 5 only, older versions of Laravel should use version 1.3.4 instead

Installation

Add webpatser/laravel-countries to composer.json.

"webpatser/laravel-countries": "dev-master"

Run composer update to pull down the latest version of Country List.

Edit app/config/app.php and add the provider and filter

'providers' => [
    'Webpatser\Countries\CountriesServiceProvider',
]

Now add the alias.

'aliases' => [
    'Countries' => 'Webpatser\Countries\CountriesFacade',
]

Model

You can start by publishing the configuration. This is an optional step, it contains the table name and does not need to be altered. If the default name countries suits you, leave it. Otherwise run the following command

$ php artisan vendor:publish

Next generate the migration file:

$ php artisan countries:migration

It will generate the <timestamp>_setup_countries_table.php migration and the CountriesSeeder.php seeder. To make sure the data is seeded insert the following code in the seeds/DatabaseSeeder.php

//Seed the countries
$this->call('CountriesSeeder');
$this->command->info('Seeded the countries!'); 

You may now run it with the artisan migrate command:

$ php artisan migrate --seed

After running this command the filled countries table will be available

laravel-countries's People

Contributors

dmsherazi avatar eigan avatar ferdirn avatar foo99 avatar jpmurray avatar juliangums avatar kevindierkx avatar khaledsmq avatar kitbs avatar lucidlemon avatar mannikj avatar mateusfccp avatar msamec avatar multiwebinc avatar ognjenm avatar paulkned avatar pjona avatar robindirksen1 avatar ryanrapini avatar stewis avatar taftse avatar teeli avatar tsiedsma avatar twmbx avatar watscho avatar webpatser avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.