Giter VIP home page Giter VIP logo

larawoo's Introduction

LaraWoo!

Total Downloads Latest Stable Version License

A Simple and Elegant Wrapper fro the Automattic WooCommerce PHP Library.

Introduction

This project started after the need to integrate WooCommerce with a Clients backoffice system was identified. The idea was to create a small Laravel/Lumen service to run externally to WooCOmmerce that took the data from the back office system and fed it into WooCommerce across the REST API Endpoints. On the flip side we needed to also pass data back the other way. We felt that having WordPress handle this internally could be more complex than just using a Laravel API Data Service to handle this functionality.

Installation Laravel 5.5 +

Just use composer to drop this package in and let Auto Discover do its wonderful thing!

composer require ollywarren/larawoo

Publish the vendor configuration:

php artisan vendor:publish (Select the relevant package from the list)

Set the environment variables in your Apps .env file:

LARAWOO_URL="<YOUR WOOCOMMERCE INSTALL URL>"
LARAWOO_CONSUMER_KEY="<YOUR CONSUMER KEY>"
LARAWOO_CONSUMER_SECRET="<YOUR CONSUMER SECRET>"

Review the other avilable options in the documentation linked below and in the included larawoo configuration file.

Installation Laravel 5.4

Use composer to add it to your project dependencies:

composer require ollywarren/larawoo

Then inside your config/app.php

Add the package service provider to the providers array:

Ollywarren\Larawoo\LaraWooServiceProvider::class,

Add the facade to the alias array:

[
    'Larawoo' => 'Ollywarren\Larawoo\Facades\Larawoo::class'
]

Finally for good measure dump the composer autoloader to make sure we've pulled in the helper method:

composer dump-autoloader

Publish the vendor configuration:

php artisan vendor:publish

Set the environment variables in your Apps .env file:

LARAWOO_URL="<YOUR WOOCOMMERCE INSTALL URL>"
LARAWOO_CONSUMER_KEY="<YOUR CONSUMER KEY>"
LARAWOO_CONSUMER_SECRET="<YOUR CONSUMER SECRET>"

Usage Instructions

The included helper method makes accessing the underlying methods as easy as:

$results = larawoo()->get('customers');
// ['customers' => [[ 'id' => 8, 'created_at' => '2015-05-06T17:43:51Z', 'email' => ...

Or With the Facade if youd prefer

$results = Larawoo::get('customers');
// ['customers' => [[ 'id' => 8, 'created_at' => '2015-05-06T17:43:51Z', 'email' => ...

For a full breakdown of the available methods please see Automattic's Package Page for the library:

WooCommerce API Library Packagist Package

WooCommerce API Documentation

larawoo's People

Contributors

ollywarren avatar

Watchers

James Cloos avatar

Forkers

wai1496

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.