This is restfull api package. You can easily extend it and add more apis
- Download or clone the package
- Open Class/Db.php file and replace database credentials with yours
- Start install.php file (Example: http://yoursite.com/install.php)
- Download or clone:
- The package
- Or only start.sh file.
- Run start.sh on terminal and it will automatically install and initialize mysql, create database and user.
PS. set chmod +x to start.sh file in order to make it executable
At the moment there is one api for orders Which has:
- Creating an order: http://yoursite.com/order (POST request)
- Update an order (setting status to "taken"): http://yoursite.com/order/:id (PUT request)
- Get list of orders: http://yoursite.com/orders (GET request)
- Open api/order/index.php and add new case
- Open Classes/Orders.php class and add new method and codes you need
- Create new class which extends Api.php class in Classes folder
- Add new folder in api folder and create index.php file and begin to write your api
Destination and origin coordinates are written in api/orders/index.php DEFAULT switch case Also You can create an html file where the user can select his destination with gmaps and send destination coordinates