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.
- 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
-
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.
- 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
- Input both postcode and api_key then search
- Success! Query after both valid api_key and postcode.
! Lastly Query more. Note! The locations data is dummy feel free to insert yours and use The end