2017 © Pedro Peláez
 

library laravel-norwegian-zip-codes

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

image

phaza/laravel-norwegian-zip-codes

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

  • Thursday, March 23, 2017
  • by phaza
  • Repository
  • 1 Watchers
  • 1 Stars
  • 830 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

This package was sponsored by tjenestetorget.no / [TFinans.no][2]

What?

This package contains models, migrations and commands to automatically setup and update the administrative hierarchy of zip codes, municipalities and counties in Norway., (*1)

How

Install the package, (*2)

composer require "phaza/laravel-norwegian-zip-codes"

Add service provider
Add NorwegianZipCodes\Providers\NorwegianZipCodesServiceProvider in config/app.php to the 'providers' array, (*3)

Copy migrations to your migrations folder, (*4)

php artisan vendor:publish --provider="NorwegianZipCodes\Providers\NorwegianZipCodesServiceProvider"

Run migrations, (*5)

php artisan migrate

Seed the database, (*6)

php artisan db:seed --class="NorwegianZipCodeSeeds"

Populate the database, (*7)

php artisan zip_codes:update

Start using the models, (*8)

    $zip_code     = \NorwegianZipCodes\Models\ZipCode::find('7340');
    $municipality = $zip_code->municipality;
    $county       = $municipality->county

ER diagram

ER diagram, (*9)

Note

All IDs for counties, municipalities and zip_codes are strings. This is because officially the IDs are zero padded, fixed size. (4 for zip codes and municipalities, 2 for counties), (*10)

The Versions

23/03 2017

dev-master

9999999-dev

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Haza

06/08 2015

0.7

0.7.0.0

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Haza

03/07 2015

0.6

0.6.0.0

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Haza

30/06 2015

0.5

0.5.0.0

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Haza

24/03 2015

0.4

0.4.0.0

Laravel models for Norwegian zip codes, municipalities and counties. Includes an artisan command to update data from the official authority.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Haza