ncaneldiee/rajaongkir-laravel

Laravel Raja Ongkir API

v1.0.0 2016-11-06 18:16 UTC

This package is not auto-updated.

Last update: 2024-11-23 21:56:24 UTC


README

Latest Version Total Download Software License

Installation

Using composer.

$ composer require ncaneldiee/rajaongkir-laravel

Add service provider to config/app.php.

    ...
    'Ncaneldiee\Rajaongkir\Laravel\RajaongkirServiceProvider',
    ...

Add alias to config/app.php.

    ...
    'Rajaongkir\Domestic' => 'Ncaneldiee\Rajaongkir\Laravel\RajaongkirDomesticFacade',
    'Rajaongkir\International' => 'Ncaneldiee\Rajaongkir\Laravel\RajaongkirInternationalFacade',
    ...

Publish vendor.

$ php artisan vendor:publish

Configuration

Set your configuration using environment variable.

RAJAONGKIR_ACCOUNT_TYPE=YOUR_ACCOUNT_TYPE
RAJAONGKIR_API_KEY=YOUR_API_KEY

Example

Rajaongkir\Domestic::cost($origin, $destination, $weight, $courier);

Rajaongkir\Domestic::waybill($tracking_number, $courier);

Full documentation can be found at the wiki.

License

The MIT License (MIT). Please see LICENSE for more information.