Git Product home page Git Product logo

yclients-laravel-sdk's Introduction

Latest Stable Version Latest Unstable Version Total Downloads License

Laravel YClients SDK

Install

$ composer require e-nikitin/yclients-laravel-sdk

Publish config file

$ php artisan vendor:publish --tag=yclients-laravel-sdk

Laravel 5.5+

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

...
 nikitin\YClientsSDK\YClientsSDKServiceProvider::class
...

Set configs\yclients-laravel-sdk

'accounts' => [
     'default' => [
     // Login and password are required to receive USER TOKEN. 
     // If you have them you do not have to fill in these fields
     'login' => '',
     'password' => '',
      // Used in all requests and is mandatory
     'bearer_token' => '',
     'user_token' => ''
   ],
]

Obtain TOKENS

Bearer token can be recived from yclients support.

To obtain user token set login, password and bearer token in configs and run

    use nikitin\YClientsSDK\Facades\YClientsSDK;
    ...
    YClientsSDK::authorization()->get() // return USER TOKEN

Supported API methods

  • Authorization
  • Clients
  • Companies
  • Goods
  • Records
  • Salons
  • Services
  • ServiceCategory
  • Staff
  • Visits
    • VisitDetails

Examples

Clients

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$clients = YClientsSDK::clients()->setCompany($companyId)->get();

Companies

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$companies = YClientsSDK::companies()->setSalonId($salonId)->get();

Goods

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$goods = YClientsSDK::goods()->setCompany($companyId)->get();

Records

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$records = YClientsSDK::records()->setCompany($companyId)->setChangedAfter(Carbon::today())->get();

Groups

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$salons = YClientsSDK::groups()->get();

ServiceCategory

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$serviceCategory = YClientsSDK::serviceCategory()->setCompany($companyId)->get();

Staff

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$staff = YClientsSDK::staff()->setCompany($companyId)->get();

Visits

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$visits = YClientsSDK::visits()->setVisitId($visitId)->get();

VisitDetails

use nikitin\YClientsSDK\Facades\YClientsSDK;
...
$visitDetails = YClientsSDK::visitDetails()->setVisitId($visitId)->setSalonId($salonId)->setRecordId($recordId)->get();

License

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

yclients-laravel-sdk's People

Contributors

e-nikitin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.