{"id":15685156,"url":"https://github.com/unicodeveloper/laravel-ngsc","last_synced_at":"2025-05-07T17:52:09.389Z","repository":{"id":57075436,"uuid":"50444065","full_name":"unicodeveloper/laravel-ngsc","owner":"unicodeveloper","description":":package: :four_leaf_clover: Laravel 5 Package that provides a fluent API for states and cities in Nigeria","archived":false,"fork":false,"pushed_at":"2018-07-29T01:31:47.000Z","size":9,"stargazers_count":10,"open_issues_count":5,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T17:52:02.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unicodeveloper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-26T16:57:41.000Z","updated_at":"2024-04-16T15:45:33.000Z","dependencies_parsed_at":"2022-08-24T14:55:43.323Z","dependency_job_id":null,"html_url":"https://github.com/unicodeveloper/laravel-ngsc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-ngsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-ngsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-ngsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-ngsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unicodeveloper","download_url":"https://codeload.github.com/unicodeveloper/laravel-ngsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931391,"owners_count":21827104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:24:04.681Z","updated_at":"2025-05-07T17:52:09.369Z","avatar_url":"https://github.com/unicodeveloper.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-ngsc\n\n[![Latest Stable Version](https://poser.pugx.org/unicodeveloper/laravel-ngsc/v/stable.svg)](https://packagist.org/packages/unicodeveloper/laravel-ngsc)\n![](https://img.shields.io/badge/unicodeveloper-approved-brightgreen.svg)\n[![License](https://poser.pugx.org/unicodeveloper/laravel-ngsc/license.svg)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/unicodeveloper/laravel-ngsc.svg)](https://travis-ci.org/unicodeveloper/laravel-ngsc)\n[![Quality Score](https://img.shields.io/scrutinizer/g/unicodeveloper/laravel-ngsc.svg?style=flat-square)](https://scrutinizer-ci.com/g/unicodeveloper/laravel-ngsc)\n[![Total Downloads](https://img.shields.io/packagist/dt/unicodeveloper/laravel-ngsc.svg?style=flat-square)](https://packagist.org/packages/unicodeveloper/laravel-ngsc)\n\n\u003e A Laravel 5 Package for providing a fluent API for states, lgas and cities in Nigeria\n\n## Installation\n\n[PHP](https://php.net) 5.4+ or [HHVM](http://hhvm.com) 3.3+, and [Composer](https://getcomposer.org) are required.\n\nTo get the latest version of Laravel Ngsc, simply add the following line to the require block of your `composer.json` file.\n\n```\n\"unicodeveloper/laravel-ngsc\": \"1.0.*\"\n```\n\nYou'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.\n\nOnce Laravel Ngsc is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key.\n\n* `Unicodeveloper\\Ngsc\\NgscServiceProvider::class`\n\nAlso, register the Facade like so:\n\n```php\n'aliases' =\u003e [\n    ...\n    'Ngsc' =\u003e Unicodeveloper\\Ngsc\\Facades\\NgscFacade::class,\n    ...\n]\n```\n\n## Configuration\n\nTo get started, you'll need to publish all vendor assets:\n\n```bash\n$ php artisan vendor:publish --provider=\"Unicodeveloper\\Ngsc\\NgscServiceProvider\"\n```\n\n## Usage\n\nYou can use it in your controller by using Dependency Injection like so:\n\n```php\n\u003c?php\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\n\nuse App\\Http\\Requests;\nuse Unicodeveloper\\Ngsc\\Ngsc;\nuse App\\Http\\Controllers\\Controller;\n\nclass StateController extends Controller\n{\n    protected $ngsc;\n\n    public function __construct(Ngsc $ngsc)\n    {\n        $this-\u003engsc = $ngsc;\n    }\n\n    /**\n     * Get all states\n     * @return array\n     */\n    public function getAllStates()\n    {\n        return $this-\u003engsc-\u003egetAllStates();\n    }\n}\n```\n\nYou can also simply use the awesome Facades like so:\n\n```php\n\n/**\n * Gets all the states in Nigeria\n * @return array\n */\nNgsc::getAllStates()\n\n/**\n * Gets the details of just one state, e.g capital, lat, lng\n * @param string  state or state code\n * @return array\n */\nNgsc::getOneState('lagos') OR Ngsc::getOneState('LA')\n\n/**\n * Gets the local government areas of just one state\n * @param string  state or state code\n * @return array\n */\nNgsc::getLGAS('lagos') OR Ngsc::getLGAS('LA')\n\n/**\n * Gets the cities of just one state\n * @param string  state or state code\n * @return array\n */\nNgsc::getCities('lagos') OR Ngsc::getCities('LA')\n```\n\n## Appreciation\n\nHuge thanks go to the [Devcenter.co](http://devcenter.co/square) crew for providing a fluent and awesome API\n\n## Contributing\n\nPlease feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.\n\n## How can I thank you?\n\nWhy not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!\n\nDon't forget to [follow me on twitter](https://twitter.com/unicodeveloper)!\n\nThanks!\nProsper Otemuyiwa.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodeveloper%2Flaravel-ngsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funicodeveloper%2Flaravel-ngsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodeveloper%2Flaravel-ngsc/lists"}