Skip to content
/ wefact Public
forked from hyperized/hostfact

Unofficial implementation of the WeFact API v2 for Laravel 5

License

Notifications You must be signed in to change notification settings

bitency/wefact

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeFact API 2.3 for Laravel 5

Build Status

Official documentation:

Installation

Install using composer:

composer require hyperized/wefact

Register the Wefact ServiceProvider, open config/app.php:

Hyperized\Wefact\WefactServiceProvider::class,

Register a alias for Wefact, also in config/app.php:

'Wefact'    => Hyperized\Wefact\WefactServiceProvider::class,

Now publish the Wefact package into your installation:

php artisan vendor:publish

This should give you a message like: Copied File [/vendor/hyperized/wefact/src/config/Wefact.php] To [/config/Wefact.php]

Now edit your configuration variables in the newly installed config/Wefact.php

'api_v2_url'		=> 'https://yoursite.tld/Pro/apiv2/api.php',
'api_v2_key'		=> 'token',
'api_v2_timeout'	=> 10,

Example code:

// Direct use
  $product = new Hyperized\Wefact\Types\Product();
  $productParams = [
    'searchfor' => 'invoice'
  ];
  $output = $product->list($productParams);

// Use in Controllers
use Hyperized\Wefact\Types\Product;

class MyController extends Controller {
  public function getProducts()
  {
    $product = new Product();
    $productParams = [
      'searchfor' => 'invoice'
    ];
    return $product->list($productParams);
  }

About

Unofficial implementation of the WeFact API v2 for Laravel 5

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%