{"id":16467255,"url":"https://github.com/irfaardy/raja-ongkir","last_synced_at":"2025-10-26T22:03:52.932Z","repository":{"id":39747259,"uuid":"242054297","full_name":"irfaardy/raja-ongkir","owner":"irfaardy","description":"Raja Ongkir Plugin for Laravel Framework 5/6/7 and PHP Native🚀","archived":false,"fork":false,"pushed_at":"2021-01-21T10:46:40.000Z","size":165,"stargazers_count":13,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T03:42:19.149Z","etag":null,"topics":["cache","cek-ongkir","city","composer","courier","kirim","laravel","ongkir","ongkos","php","plugin","plugins","province","raja-ongkir","rajaongkir"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irfaardy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"irfa","ko_fi":"irfaardy","custom":["https://buymeacoff.ee/irfaardy"]}},"created_at":"2020-02-21T04:30:39.000Z","updated_at":"2022-07-07T04:43:51.000Z","dependencies_parsed_at":"2022-08-21T10:40:41.035Z","dependency_job_id":null,"html_url":"https://github.com/irfaardy/raja-ongkir","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fraja-ongkir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fraja-ongkir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fraja-ongkir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fraja-ongkir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irfaardy","download_url":"https://codeload.github.com/irfaardy/raja-ongkir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244117640,"owners_count":20400743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cek-ongkir","city","composer","courier","kirim","laravel","ongkir","ongkos","php","plugin","plugins","province","raja-ongkir","rajaongkir"],"created_at":"2024-10-11T11:46:43.036Z","updated_at":"2025-10-26T22:03:47.897Z","avatar_url":"https://github.com/irfaardy.png","language":"PHP","funding_links":["https://patreon.com/irfa","https://ko-fi.com/irfaardy","https://buymeacoff.ee/irfaardy","https://www.buymeacoffee.com/irfaardy","https://ko-fi.com/S6S52P7SN"],"categories":[],"sub_categories":[],"readme":"# 🚀Raja Ongkir Laravel Package\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/irfaardy/raja-ongkir/badges/quality-score.png?b=master) ](https://scrutinizer-ci.com/g/irfaardy/raja-ongkir/?branch=master)[![Build Status](https://scrutinizer-ci.com/g/irfaardy/raja-ongkir/badges/build.png?b=master)](https://scrutinizer-ci.com/g/irfaardy/raja-ongkir/build-status/master) [![Latest Stable Version](https://poser.pugx.org/irfa/raja-ongkir/v/stable)](https://packagist.org/packages/irfa/raja-ongkir) ![PHP](https://github.com/irfaardy/raja-ongkir/workflows/PHP/badge.svg?branch=master) \n\n\u003ca href=\"https://www.buymeacoffee.com/irfaardy\" target=\"_blank\"\u003e\u003cimg width=\"130px\" src=\"https://cdn.buymeacoffee.com/buttons/lato-red.png\" alt=\"Buy Me A Coffee\"  \u003e\u003c/a\u003e [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S52P7SN)\n\n\nPackage ini berguna untuk mengecek biaya ongkos kirim dari kurir, package ini dapat digunakan di Laravel 5/6/7 atau PHP Native.\n**(untuk saat ini hanya mendukung tipe akun starter)**\n\n\n\u003ch3\u003e🛠️ Installation with Composer \u003c/h3\u003e\n\n```php\ncomposer require irfa/raja-ongkir\n```\n\n\u003eYou can get Composer [ here]( https://getcomposer.org/download/)\n\n\n\n\n\u003ch2\u003e🛠️ PHP Native Setup\u003c/h2\u003e\n\n\n```php\n  \u003c?php \n     require \"vendor/autoload.php\";\n        \n     use Irfa\\RajaOngkir\\Ongkir\\Ongkir as RajaOngkir;\n     ....\n```\n\n\u003cb\u003eConfiguration File\u003c/b\u003e\n\n\u003e **Config location :** vendor/irfa/raja-ongkir/config/config.php\n\n```php\n\u003c?php\n\t$config = [\n\t\t'account_type' =\u003e 'your-account-type',\n\n\t\t'api_key' =\u003e 'your-api-key',\n\t];\n```\n\n\u003e You can get API key in [Raja Ongkir](https://rajaongkir.com/).\u003cbr\u003e Account type supported : starter.\n\n***\n\n\u003ch2\u003e🛠️ Laravel Setup \u003c/h2\u003e\n\n\u003ch3\u003eAdd to config/app.php\u003c/h3\u003e\n\n```php\n'providers' =\u003e [\n      ....\n         Irfa\\RajaOngkir\\RajaOngkirServiceProvider::class, \n     ];\n```\n\n\n\n\u003ch3\u003eAdd to config/app.php\u003c/h3\u003e\n\n```php\n'aliases' =\u003e [\n         ....\n    'RajaOngkir' =\u003e Irfa\\RajaOngkir\\Facades\\Ongkir::class,\n\n    ],\n```\n\n  \u003ch2\u003ePublish Vendor\u003c/h2\u003e\n\n\n```php\nphp artisan vendor:publish --tag=raja-ongkir\n```\n\nOpen .env file and add this line\n\n    ....\n    RAJAONGKIR_ACCOUNT_TYPE=starter\n    RAJAONGKIR_API_KEY=your-api-key\n    RAJAONGKIR_PROV_TABLE=ro_province\n    RAJAONGKIR_CITY_TABLE=ro_city\n    RAJAONGKIR_CACHE=database\n\n***\n\n\u003ch2\u003e🚀 Caching\u003c/h2\u003e\n\n\u003e Caching is useful for loading city and province faster🚀.\u003cbr\u003eYou can change cache type in ***config/irfa/rajaongkir.php or project_name/.env***. \u003cbr\u003e**This function currently only supports the Laravel Framework**\u003cbr\u003e\u003cbr\u003e**Cache support :**  database and file\u003cbr\u003e ( if you don't want to use cache you can set it to *null* )\n\n\n**Migrating table city and provinsi**\n\n\u003e If you want to use database cache, you must run migrate first. \n\n    php artisan migrate\n\n\u003ch3\u003eCaching Province,Sub-District and City\u003c/h3\u003e\u003cbr\u003e\n\nOpen console/cmd and run\n\n    php artisan raja-ongkir:cache all\n\n\u003ch3\u003eCaching City\u003c/h3\u003e\u003cbr\u003e\n\nOpen console/cmd and run\n\n    php artisan raja-ongkir:cache city\n\n\u003ch3\u003eCaching Province\u003c/h3\u003e\u003cbr\u003e\n\nOpen console/cmd and run\n\n    php artisan raja-ongkir:cache province\n\n\u003ch3\u003eClear Cache\u003c/h3\u003e\u003cbr\u003e\n\nOpen console/cmd and run\n\n    php artisan raja-ongkir:cache clear\n\n\u003ch3\u003eRefresh Cache\u003c/h3\u003e\u003cbr\u003e\n\nClear old cache and create latest cache.\u003cbr\u003e\nOpen console/cmd and run\n\n    php artisan raja-ongkir:cache refresh\n\n***\n\n  \u003ch3\u003e💻 Usage\u003c/h3\u003e\n\n```php\n  use RajaOngkir;\n```\n\n\u003ch3\u003eRetrieve all province\u003c/h3\u003e\n\n```php\n $get = RajaOngkir::province()-\u003eget();\n foreach($get as $prov)\n {\n\techo $prov-\u003eprovince_id.\"\u003cbr\u003e\"; // value = 1\n\techo $prov-\u003eprovince.\"\u003cbr\u003e\";// value = Bali\n }\n```\n\n\u003ch3\u003eSearch province\u003c/h3\u003e\n\n \n\n```php\n   $get = RajaOngkir::find(['province_id' =\u003e 1])-\u003eprovince()-\u003eget();\n\techo $get-\u003eprovince_id.\"\u003cbr\u003e\"; // value = 1\n\techo $get-\u003eprovince.\"\u003cbr\u003e\";// value = Bali\n```\n\n   \n\n\u003ch3\u003eRetrieve all City\u003c/h3\u003e\n\n```php\n$get = RajaOngkir::city()-\u003eget();\nforeach($get as $city)\n{\n\techo $city-\u003ecity_id.\"\u003cbr\u003e\"; // value = 17\n\techo $city-\u003eprovince_id.\"\u003cbr\u003e\";// value = 1\n\techo $city-\u003eprovince.\"\u003cbr\u003e\";// value = Bali\n\techo $city-\u003etype.\"\u003cbr\u003e\"; // value = Kabupaten\n\techo $city-\u003ecity_name.\"\u003cbr\u003e\"; // value = Badung\n\techo $city-\u003epostal_code.\"\u003cbr\u003e\"; // value = 80351\n}\n```\n\n\u003ch3\u003eRetrieve all city in province\u003c/h3\u003e\n\n\n```php\n    $get = RajaOngkir::find(['province_id' =\u003e 1])-\u003ecity()-\u003eget();\n    foreach($get as $city){\n\t\techo $city-\u003ecity_id.\"\u003cbr\u003e\"; // value = 17\n\t\techo $city-\u003eprovince_id.\"\u003cbr\u003e\";// value = 1\n\t\techo $city-\u003eprovince.\"\u003cbr\u003e\";// value = Bali\n\t\techo $city-\u003etype.\"\u003cbr\u003e\"; // value = Kabupaten\n\t\techo $city-\u003ecity_name.\"\u003cbr\u003e\"; // value = Badung\n\t\techo $city-\u003epostal_code.\"\u003cbr\u003e\"; // value = 80351\n     }\n```\n\n  \u003ch3\u003eRetrieve courier\u003c/h3\u003e\n\n\n```php\n  $get = RajaOngkir::find(['origin'=\u003e1,'destination'=\u003e2,'weight'=\u003e1000,'courier' =\u003e 'jne'])\n\t -\u003ecourier()-\u003eget();\n  foreach($get as $city)\n  {\n\techo $city-\u003ecode.\"\u003cbr\u003e\"; // value = jne\n\techo $city-\u003ename.\"\u003cbr\u003e\";// value = Jalur Nugraha Ekakurir (JNE)\n  }\n```\n\n\u003ch3\u003eRetrieve  cost courier\u003c/h3\u003e\n\n\n```php\n $params = ['origin'=\u003e1,'destination'=\u003e2,'weight'=\u003e1000,'courier' =\u003e 'jne'\n\t\t\t   ];\n     $get = RajaOngkir::find($params)-\u003ecostDetails()-\u003eget();\n     foreach($get as $cost)\n     {\n\techo \"Courier Name: \".$cost-\u003eservice.\"\u003cbr\u003e\";\n\techo \"Description: \".$cost-\u003edescription.\"\u003cbr\u003e\";\n\t foreach($cost-\u003ecost as $detail)\n\t {\n\t\techo \"Harga: \".$detail-\u003evalue.\"\u003cbr\u003e\";\n\t\techo \"Estimasi: \".$detail-\u003eetd.\"\u003cbr\u003e\";\n\t\techo \"Note: \".$detail-\u003enote.\"\u003cbr\u003e\";\n\t\techo \"\u003chr\u003e\";\n\t }\n      }\n```\n\n## How to Contributing?\n\n1. Fork it (\u003chttps://github.com/irfaardy/raja-ongkir/fork\u003e)\n2. Commit your changes (`git commit -m 'New Feature'`)\n3. Push to the branch (`git push origin master`)\n4. Create a new Pull Request\n\nif you found bug or error, please post here https://github.com/irfaardy/raja-ongkir/issues so that they can be maintained together.\n\n\n\n***\n## Bagaimana cara berkontribusi?\n\n1. Lakukan fork di (\u003chttps://github.com/irfaardy/raja-ongkir/fork\u003e)\n2. Commit perubahan yang anda lakukan (`git commit -m 'Fitur Baru'`)\n3. Push ke branch master (`git push origin master`)\n4. Buat Pull Request baru\n\n---\n## Issue\nIf you found issues or bug please create new issues here https://github.com/irfaardy/php-gacha/issues/new\n\nJika anda menemukan bug atau error silahkan posting disini https://github.com/irfaardy/raja-ongkir/issues agar dapat diperbaiki bersama-sama.\n***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firfaardy%2Fraja-ongkir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firfaardy%2Fraja-ongkir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firfaardy%2Fraja-ongkir/lists"}