Skip to content

nidhhoggr/loopback-sdk-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loopback SDK PHP

A SDK for interfacing a Loopback Application with PHP. Some of the code is borrowed from touhonoob of Crowsdom. Thanks pal!

Instructions

  1. First copy loopback.dist.json to loopback.json and customize accordingly
  2. Specify models with cooresponding modelName and endPoint
  3. Generate the config files
$ bin/loopback-sdk-php generate:config:all
  1. Generate the model files
$ bin/loopback-sdk-php generate:class:all

Example

require("vendor/autoload.php");

$apiHost = "https://api.company.com/api/";
$authEndPoint = "users/login";
$authCredentials = [
  'email' => 'joseph.persie@company.com',
  'password' => '1sdfe4r43r'
];

try {

  $loopbackPhpSdk = new \LoopbackSDKPHP\LoopbackSDKPHP(
    $apiHost,
    $authEndPoint,
    $authCredentials,
    null,
    ['debug' => true]
  );

  $apiClient = $loopbackPhpSdk->getClient();

  $Subscriber = new \LoopbackSDKPHP\Models\Base\Subscriber($apiClient, 4);
}
catch(Exception $e) {
  var_dump($e->getMessage());
}

About

An SDK generator for StrongLoop Loopback in PHP.

Resources

License

Stars

Watchers

Forks

Packages

No packages published