hnhdigital-os/laravel-datasets

Provides console commands, models and migration scripts to syncronize datasets.

v1.2.1 2018-01-10 14:32 UTC

This package is auto-updated.

Last update: 2024-10-22 01:57:00 UTC


README

   ___        _                     _
  /   \ __ _ | |_  __ _  ___   ___ | |_  ___ 
 / /\ // _` || __|/ _` |/ __| / _ \| __|/ __|
/ /_//| (_| || |_| (_| |\__ \|  __/| |_ \__ \
/___,'  \__,_| \__|\__,_||___/ \___| \__||___/

Provides console commands, models and migration scripts to syncronize datasets into your applications database. Datasets are defined by array based configuration whilst advanced manipulation or data retrieval can be done through inline closures.

Latest Stable Version Total Downloads Latest Unstable Version Built for Laravel License

Build Status StyleCI Test Coverage Issue Count Code Climate

This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.

Install

Via composer:

$ composer require hnhdigital-os/laravel-datasets ~1.0

This package's service provider will autoload from Laravel 5.5.

To enable the service provider in versions prior to Laravel 5.4, edit the config/app.php:

    'providers' => [
        ...
        HnhDigital\Datasets\ServiceProvider::class,
        ...
    ];

Available datasets

DATA.OKFN Collection (hnhdigital-os/laravel-datasets-okfn)

NOTE: This collection is included by default when you install this package.

  • Country Codes
  • Country Population
  • Country Population (current)
  • Language Codes

Australia Collection (hnhdigital-os/laravel-datasets-australia)

  • Banks
  • BSB
  • Postcodes

Need a dataset? Request it, Pull Request it, or build it. Use the DATA.OKFN as a template.

If you do setup your own collection, please let us know so that we can put it on the official list.

Usage

List

$ php artisan datasets:list

Lists all the available dataset collections available to be installed.

Install

$ php artisan datasets:install {dataset}

Installs the specified dataset. This will create the table in the database and do an initial sync of the data.

Migrate

$ php artisan datasets:migrate {dataset}

Setup the table in the database. This will create the migration file in the right spot and add to the migrations table.

Use this console command when scheduling dataset update.

Sync

$ php artisan datasets:sync {dataset}

Downloads the data and insert/updates the existing records.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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