PHP Classes

NatterBase PHP Get Country API: API to get information about countries

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 79 All time: 10,129 This week: 206Up
Version License PHP version Categories
natterbase 1.0.0The PHP License5PHP 5, Web services, Geography
Description 

Author

This package provides an API to get information about countries.

It can can handle API HTTP requests that can perform several types of operations to manage information about countries stored in a database. Currently it can:

- Signup a new user of the API
- Login as a given API user
- Insert a new country to the list of countries associated to a continent
- Update the list of countries with a country to be associated to a continent
- Get the list of countries
- Delete a given country from the list of countries

Innovation Award
PHP Programming Innovation award nominee
January 2020
Number 8
Many applications need to obtain information about countries that is vital for the operations that those applications need to perform, like for instance, what is the continent that a country belongs.

This package provides an API that can make country related information be provided to many applications at once.

Since the country information that is provided by the API can be also be updated via the same API, this package can be used to dynamically update the information related with countries that it provides.

Manuel Lemos
Picture of Zacchaeus Bolaji
  Performance   Level  
Innovation award
Innovation award
Nominee: 12x

Winner: 1x

 

Documentation

natterbase

Create a RESTFUL API for performing CRUD operations on a Country resource using laravel PHP framework.

Getting Started

  • Copy the `.env.example` file to `.env` and edit the details for your environment
  • Run `composer install` to install all php dependencies
  • Create your database and set the proper environment variables in your `.env` file.
  • Run `php artisan migrate --seed` to get the database up and running
  • Run `php artisan jwt:secret` to set jwt secret

Routes

POST - /signup payload => { 'username' => ,

		'email' => ,
		'first_name' => ,
		'last_name' => ,
		'password' => ,

}

POST - /login payload => { 'email' => ,

'password' => ,

}

POST - /countries payload => { 'name' => ,

	'continent' => ,

}

PUT - /countries/:id payload => { 'name' => ,

	'continent' => ,

}

DELETE - /countries/:id payload => none

GET - /countries payload => none

POST - /activities payload => none

Unit Tests

run php vendor/phpunit/phpunit/phpunit in Command line/terminal


  Files folder image Files (84)  
File Role Description
Files folder image.idea (5 files)
Files folder imageapp (3 files, 4 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (14 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (3 files, 2 directories)
Files folder imageresources (4 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data
Accessible without login Plain text file yarn.lock Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:79
This week:0
All time:10,129
This week:206Up