This project is for testing my skills in RESTFul API
with Laravel .
City Temperature
is a RESTful API Project with 3 APIs for client side to help to get city temperature in °C
- xampp
- php v 7.*
- composer
- node.js
- Postman ( https://www.getpostman.com/apps ) or you can use your prefer extension to your browser for example RestMan for opera
- clone Repo
git clone https://github.com/Eslam-Ayman/bit68-city-temperature.git
- cd into your project
- Install Composer Dependencies
composer install
- Create a copy of your .env file
cp .env.example .env
- Generate an app encryption key
php artisan key:generate
- If the application key is not set, your user sessions and other encrypted data will not be secure!
- Create an empty database for our application
- In the .env file, add database information to allow Laravel to connect to the database
- Migrate the database
php artisian migrate
- if you don't need to migrate so import
city_temperature.sql
in your DB
- you have to install node.js modules:
npm install
npm run dev
- run this command
php artisan serve
- open your browser on this link http://127.0.0.1:8000
- import postman collection file
city-temperature.postman_collection.json
Name | Method | URL | Header | Body ( RAW ) not (form-data) |
---|---|---|---|---|
Login | POST | http://127.0.0.1:8000/api/auth/login | Content-Type : application/json Accept : application/json |
Required Data : (email, password) Optional Data : (null) |
Register | POST | http://127.0.0.1:8000/api/auth/register | Content-Type : application/json Accept : application/json |
Required Data : (name, email, password, password_confirmation) Optional Data : (null) |
Area | GET | http://127.0.0.1:8000/api/city-temperature?city_name=cairo | Content-Type : application/json Accept : application/json Authorization : Bearer |
null |
Note: if you want to send data in Body Format (form-data) so you must remove
Content-Type
from Header
- metaweather has been used in this project
- openweathermap.org
Note: the free api that has been used in this project doesn't support all world cities so check availabe city from here https://www.metaweather.com/map/
Package used in this project bioudi / laravel-meta-weather-api && guzzlehttp/guzzle
Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.
to install it using composer composer require guzzlehttp/guzzle
GNU GPL License
Author : Eslam Ayman