ronald-kimeli / laravel-postcodes-api

This is a laravel Postcode API code where you shall provide a valid Postcode then you will get json response with corresponding Latitude, Longitude and Location where the postcode is located.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel postcodes API

Build on Laravel RESTFUL API using api_key middleware, jQuery and Bootstrap Css. You inquire Street Address, Latitude and Longitude using API key and postcode.

Installation

  • clone this project into your machine
git clone https://github.com/ronald-kimeli/laravel-postcodes-api.git
  • Install project dependencies
composer install
npm install
  • Create .env file through copy
cp .env.example .env
  • Provide database credentials below in .env file
    DB_DATABASE=?
    DB_USERNAME=?
    DB_PASSWORD=?
  • Generate new key, migrations/seeding and optimize the application before running the server
php artisan migrate:fresh --seed && php artisan key:generate && php artisan optimize

Run the application

  • On terminal split into two

  • First one || Run laravel app

php artisan serve
  • Second One || Run Node for bundling frontend
npm run dev
  • Navigate to the browser.

Testing

  • On Browser

You need to copy api_key on the button API_KEY and paste as api_key then provide a valid postcode and click search as shown below.

  • The blank application before querying locations

alt text

  • Input both postcode and api_key then search

alt text

  • Success! Query after both valid api_key and postcode.

alt text

! Lastly Query more. Note! The locations data is dummy feel free to insert yours and use The end

About

This is a laravel Postcode API code where you shall provide a valid Postcode then you will get json response with corresponding Latitude, Longitude and Location where the postcode is located.


Languages

Language:PHP 84.8%Language:JavaScript 7.5%Language:Blade 4.8%Language:CSS 2.8%