favoriabs / ngstatelga by favoriabs

A laravel package that helps with Nigerian states and local government areas
310
6
2
Package Data
Maintainer Username: favoriabs
Maintainer Contact: favoriabs@gmail.com (Favor Oriabure)
Package Create Date: 2017-03-14
Package Last Update: 2019-09-07
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:00:32
Package Statistics
Total Downloads: 310
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 6
Total Watchers: 2
Total Forks: 2
Total Open Issues: 1

ngstatelga

Introduction

This laravel package helps developers with Nigerian states and local government areas.

Installation

PHP 5.4+ and Composer is required.

To get this package, simply add the following line to the require block of your composer.json file.

  composer require favoriabs/ngstatelga:1.0.0

Once the NgStateLga is installed, you need to register the service provider. Open up config/app.php and add the following to the providers section.

  • Favoriabs\NgStateLga\NgStateLgaServiceProvider::class,

Usage

After this is done, you'll need to run the following commands.

  • php artisan vendor:publish . This will publish migration files for both states and local government areas to your migration file. It will also publish seeder files. It will also publish the view page, so you can edit it as you want the page to be.

When this is done, you will need to run php artisan migrate to migrate. Then php artisan db:seed to seed with the appropriate states and local government areas. Do not forget to add the classes for the seeder files to DatabaseSeeder.php like so:

  $this->call(StatesTableSeeder::class);
  $this->call(Lgas_1_TableSeeder::class);
  $this->call(Lgas_2_TableSeeder::class);
  $this->call(Lgas_3_TableSeeder::class);
  $this->call(Lgas_4_TableSeeder::class);

You can now navigate to the appropriate route (/ngstatelga) at the root of your app like so:

localhost:8000/ngstatelga

This should load up a view with the all Nigerian states and their respective local government areas.

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

License

The MIT License (MIT).