Giter Site home page Giter Site logo

laravel-ekomi's Introduction

laravel-ekomi

Latest Stable Version Total Downloads License

lararvel-ekomi based on eKomi_APIv3

Installation

First, you'll need to install the package via Composer:

$ composer require bhavinjr/laravel-ekomi

If you are don't use using Laravel 5.5.* Then, update config/app.php by adding an entry for the service provider.

'providers' => [
    // ...
    Bhavinjr\Ekomi\Providers\EkomiServiceProvider::class,
];

'aliases' => [
    //...
    "Ekomi": "Bhavinjr\Ekomi\Facades\Ekomi",
];

In command line paste this command:

php artisan config:cache

In command line again, publish the default configuration file:

php artisan vendor:publish --provider="Bhavinjr\Ekomi\Providers\EkomiServiceProvider"

Configuration

Configuration was designed to be as flexible. global configuration can be set in the config/ekomi.php file.

after update config/ekomi.php file.

php artisan config:cache

Usage

The package gives you the following methods to use:

PutProduct

use Bhavinjr\Ekomi\Services\PutProduct;
use Ekomi;

$putProduct = new PutProduct();
$putProduct->setProductId(1)
           ->setProductName('t-shirt')
           ->setProductOther('json or serialized array') //optional. if has additional data such as categories, image_urls etc..
           ->setProductCanonicalLink('www.laravel-ekomi.com/t-shirt'); //optional

Ekomi::create($putProduct);

PutOrder

$putOrder = new PutOrder();
$putOrder->setOrderId(1)
         ->setProductIds(1) //if more than on products '1,2'
         ->setOrderTimestamp('2018-08-16'); // YYYY-MM-DD

Ekomi::create($putOrder);

PutComment

$putComment = new PutComment();
$putComment->setOrderId(1)
           ->setComment('laravel+ekomi') //Must be urlencoded.
           ->setUpdate('replace or delete'); //optional

Ekomi::create($putComment);

PutDialog

$putDialog = new PutDialog();
$putDialog->setOrderId(1)
          ->setMessage('laravel+ekomi'); //Must be urlencoded

Ekomi::create($putDialog);

PutClient

$putClient = new PutClient();
$putClient->setClientId(1)
          ->setEmail('[email protected]'); //optional

Ekomi::create($putClient);

also check other optional properties: 
setLocale, setScreenName, setFirstName, setLastName, setCountry, setCity, setZip, setGender, setBirthdate, setMetadata 

AssignClientOrder

$assignOrder = new AssignClientOrder();
$assignOrder->setOrderId(1)
            ->setClientId(1)
            ->setUnlink(false); //true if want to removes the order_id assignment

Ekomi::create($assignOrder);

GetAverage

$getAverage = new GetAverage();
$getAverage->setDays(8); //optional

Ekomi::create($getAverage);

GetDialog

$getDialog = new GetDialog();
$getDialog->setContent('process_only') //optional
	  ->setRange('all') //optional
	  ->setFilter('all'); //optional

Ekomi::create($getDialog);

GetFeedback

$getFeedback = new GetFeedback();
$getFeedback->setCaching('verylong') //optional available none, short, middle, long, verylong
	    ->fields('date,order_id'); //optional
		  	
Ekomi::create($getFeedback);

also check other optional properties: 
setFilter, setRange

Also other methods is available

GetMarketResearch, GetProduct, GetProductFeedback, GetProductResearch, GetRated, GetResearch, GetSettings, GetSnapshot, GetVisitorFeedback

also use setType and setCharset properties to any methods 

=> setType is used for output

	default type set is 'json' (json or serialized)

=> setCharset is used for Character encoding

	default charset set is 'iso'

laravel-ekomi's People

Contributors

bhavinjr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.