PHP code example of crazybee47 / laravel-bitrix24

1. Go to this page and download the library: Download crazybee47/laravel-bitrix24 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

crazybee47 / laravel-bitrix24 example snippets


class ExtendedBitrixService extends \Crazybee47\Laravel\Bitrix24\BitrixService {

    public function getContact(int $id): array {
        return $this->getApiClient()
            ->call('crm.contact.get', ['ID' => $id])
            ->getResponseData()
            ->getResult();
    }
    
    public function getContactList(array $filters = []): array {
        return $this->loadRecords('crm.contact.list', $filters);
    }
}

'bitrix' => [
    'host' => 'https://example.bitrix24.ru',
    'client_id' => env('BITRIX_CLIENT_ID'),
    'client_secret' => env('BITRIX_CLIENT_SECRET'),
    'scopes' => explode(',', env('BITRIX_SCOPES', 'crm')),//crm,bizproc,telephony
]

class VerifyCsrfToken extends Middleware
{
    protected $except = [
        'bitrix/*',
    ];
}

protected $listen = [
    \Crazybee47\Laravel\Bitrix24\Events\OnAppInstall::class => [
        'App\Listeners\RegisterBitrixWebhooks@handle'
    ],
];