e-nikitin / yclients-laravel-sdk
yclients laravel sdk
v0.3.10
2019-09-29 11:46 UTC
Requires
- php: ~7.1
- guzzlehttp/guzzle: ^6.3
- illuminate/support: ^5.4
- nesbot/carbon: >=1.0
- dev-master
- v0.3.10
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.18
- v0.2.17
- v0.2.16
- v0.2.15
- 0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2
- v0.1
- dev-analysis-qolYGP
- dev-analysis-XVMyyP
- dev-analysis-Xkww41
- dev-analysis-qJY7Yn
This package is auto-updated.
Last update: 2024-10-29 05:11:03 UTC
README
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.