Commit 3f2e5357 authored by Artem Iksanov's avatar Artem Iksanov
Browse files

Add README.md

parents
## Fast usage
```php
$newDeal = (new Meiji\BrizoCRM\Api('my-secret-token'))->with('deals')->create(['name'=>'Новая','manager_id'=>'1']);
```
## Details usage
#Implement CRUD (Create/Read/Update/Delete) model
```php
use Meiji\BrizoCRM\Api;
$bearerToken = 'dsERGE4564GBFDG34t3GDEREBbrgbdfbg4564DG3'; // Bearer Token
$brizoApi = new Api($bearerToken); // Meiji\BrizoCRM\Api::class
$brizoApiDeals = $brizoApi->with('deals'); // Meiji\BrizoCRM\Api\Deals::class
$crmDealsResult = $brizoApiDeals->limit(5)->read(); // Array[Meiji\BrizoCRM\ValueObject\Deals::class, Meiji\BrizoCRM\ValueObject\Deals::class...] @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
$crmDeal_25 = $brizoApiDeals->read(25); // Meiji\BrizoCRM\ValueObject\Deals::class @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
$brizoApiStatuses = $brizoApi->with('statuses'); // Meiji\BrizoCRM\Api\Statuses::class
$crmStatusesResult = $brizoApiStatuses->read(); // Array[Meiji\BrizoCRM\ValueObject\Statuses::class, Meiji\BrizoCRM\ValueObject\Statuses::class...] @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
$crmStatus_3 = $brizoApiStatuses->read(3); // Meiji\BrizoCRM\ValueObject\Statuses::class @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
$updatedStatus_3 = $brizoApiStatuses->update(3, ['name'=>'Обновленный этап','color_id'=>2]); // Meiji\BrizoCRM\ValueObject\Statuses::class @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
$deleteStatus_3_result = $brizoApiStatuses->delete(3); // true/false or throw Meiji\BrizoCRM\Api\Exception::class
$newCrmDeal = $brizoApiDeals->create(['name'=>'Новая','manager_id'=>'1']); // Meiji\BrizoCRM\ValueObject\Deals::class @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
$updateCrmDealName = $brizoApiDeals->update($newCrmDeal->id, ['name'=>'Новая2']); // Meiji\BrizoCRM\ValueObject\Deals::class @implement: https://jsonapi.org/format/ or throw Meiji\BrizoCRM\Api\Exception::class
```
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment