Courier API
Courier API adalah project API untuk mengetahui ongkos kirim Logistik-logistik pengiriman barang antar kota (dalam negeri) & International (dari Indonesia ke luar negeri).
Courier API dibuat menggunakan Laravel php framework, dan library rdj/rajaongkir
Installation
- Download atau Clone project ini:
$ git clone https://github.com/ranggadarmajati/courier_api.git
- Masuk folder courier_api
$ cd courier_api
- Install package:
$ composer update
- Copy .env.example ke .env
$ cp .env.example .env
- Update .env
RAJAONGKIR_APIKEY=your_api_key_raja_ongkir
RAJAONGKIR_TYPE=your_type_account(e.g:starter or basic or pro)
- Cek routing:
$ php artisan route:list
+--------+----------+------------------------------+---------------------------+---------------------------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+------------------------------+---------------------------+---------------------------------------------------------------+------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/city | city. | App\Http\Controllers\CityController@index | api |
| | GET|HEAD | api/city/{id} | city. | App\Http\Controllers\CityController@show | api |
| | GET|HEAD | api/cost | cost. | App\Http\Controllers\CostController@index | api |
| | GET|HEAD | api/cost/currency | cost. | App\Http\Controllers\CostController@currency | api |
| | GET|HEAD | api/cost/international | cost. | App\Http\Controllers\CostController@internationalCost | api |
| | GET|HEAD | api/internationaldestination | internationaldestination. | App\Http\Controllers\InternationalDestinationController@index | api |
| | GET|HEAD | api/internationalorigin | internationalorigin. | App\Http\Controllers\InternationalOriginController@index | api |
| | GET|HEAD | api/province | province. | App\Http\Controllers\ProvinceController@index | api |
| | GET|HEAD | api/province/{id} | province. | App\Http\Controllers\ProvinceController@show | api |
| | GET|HEAD | api/subdistrict | subdistrict. | App\Http\Controllers\SubdistrictController@index | api |
| | GET|HEAD | api/subdistrict/{id} | subdistrict. | App\Http\Controllers\SubdistrictController@show | api |
| | GET|HEAD | sanctum/csrf-cookie | | Laravel\Sanctum\Http\Controllers\CsrfCookieController@show | web |
+--------+----------+------------------------------+---------------------------+---------------------------------------------------------------+------------+
- Running Project
$ php artisan serve