PHP code example of x3group-dev / bitrix24-api-laravel
1. Go to this page and download the library: Download x3group-dev/bitrix24-api-laravel 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/ */
x3group-dev / bitrix24-api-laravel example snippets
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
public function install(\Bitrix24\SDK\Services\ServiceBuilder $b24): void;
'installers' => [
App\Install\InstallEvents::class,
App\Install\InstallLists::class,
// ...в нужном порядке
],
injectablephp
php artisan vendor:publish --provider="X3Group\Bitrix24\Bitrix24ServiceProvider"
injectablephp
php artisan migrate
injectablephp
BITRIX24_PHP_SDK_APPLICATION_CLIENT_ID=
BITRIX24_PHP_SDK_APPLICATION_CLIENT_SECRET=
# вместо crm,user_brief укажите скоупы приложения
BITRIX24_PHP_SDK_APPLICATION_SCOPE="crm,user_brief"
BITRIX24_LOG_MAX_FILES=3
injectablephp
BX24.ready(async function () {
await BX24.init(async function () {
window.axios.defaults.headers.common['X-b24api-access-token'] = BX24.getAuth().access_token;
window.axios.defaults.headers.common['X-b24api-refresh-token'] = BX24.getAuth().refresh_token;
window.axios.defaults.headers.common['X-b24api-domain'] = BX24.getAuth().domain;
window.axios.defaults.headers.common['X-b24api-member-id'] = BX24.getAuth().member_id;
window.axios.defaults.headers.common['X-b24api-expires-in'] = BX24.getAuth().expires_in;
});
});
injectablephp
STRUCTURED_LOG_ENABLED=true
APP_LOG_NAME=base
# необязательные:
STRUCTURED_LOG_PATH=storage/logs/structured/app.json
STRUCTURED_LOG_MAX_FILES=14
STRUCTURED_LOG_TRUNCATE_AT=200